(This is generated from the examples in https://github.com/welford/twstaticblog/ 👍 )
I keep notes on various things in Tiddlywiki and it is very useful to be able to export my blog from the same resource. Currently TiddlyWiki has a good but bare bones static export mechanism, I have made some plugins to enable something more along the lines of what I want in a static blog.
Put simply, if I tag any tiddler within my tiddlywiki with a special tag e.g.
then that tiddler will be included as part of my blog when I run the export batch file. The tags used to specify what is and what isn't an export target are configurable.I use these plugins to generate http://phasersonkill.com/
The code for this example can be found here: https://github.com/welford/twstaticblog (see example folder for this very file)
This actually required two plugins. One helper that exists within your tiddlwyiki, and another export plugin you use in a Wikifolder
Locally available here : $:/plugins/welford/twstaticblog/helper
All the tags listed below are fully customizable:
plugin tiddler | purpose |
$:/plugins/welford/twstaticblog/helper/ctrl.post | Defines which tags constitutes a blog post, defaults to |
$:/plugins/welford/twstaticblog/helper/ctrl.framework | Defines which tags constitutes a blog framework |
$:/plugins/welford/twstaticblog/helper/ctrl.donotexport | Defines which tags should not be exported even if they are tagged as a blog posts or blog frameworks |
$:/plugins/welford/twstaticblog/helper/ctrl.donotindex | Defines which tags will filtered from the index post |
$:/plugins/welford/twstaticblog/helper/ctrl.hidden | Defines which tags will be excluded from tag posts and from the tag lists below the title of artiles. |
Tag any article $:/plugins/welford/twstaticblog/helper/template.post.html . The output directory will be ./YYYY/MM/DD/[tiddlername].html
based on their creation date of the article.
You can change the tags which define a blog post via $:/plugins/welford/twstaticblog/helper/blogentrytags
e.g. This post you are reading
Any recently created article tagged with index.html
using the $:/plugins/welford/twstaticblog/helper/template.index.html. This can be prevented by also adding the tag
e.g. the exported index.html
Tag any article $:/plugins/welford/twstaticblog/helper/template.framework.html. The output location in the root directory. I define a framework article as being a post which helps you navigate the site or one that is accessabe everywhere. I have included a few example framework posts in the helper plugin.
and it will be exported as part of your blog as a "framework" post using the templatee.g. Tags, About both linked to at the top of this page
As this is a static site generator there is no search functionaity. My plugin auto-generates tag posts, using the template $:/plugins/welford/twstaticblog/helper/template.tag.html, based on any tag in blog or framework posts as a kind of simple site-map. You can exclude tags from being included in this by adding them to the tag list in $:/plugins/welford/twstaticblog/helper/hiddentags
By default the following are excluded:
e.g. <- you can click on these and jump to specified tag page.
A banner can be added to the top of every page via $:/plugins/welford/twstaticblog/helper/blog-banner in my case I use it to link to some of the framework posts.