This is a series of posts which technically describes how Not Even Odd is built.
![]() |
Static site with TiddlyWiki 1. content selection
Hosting with GitHub |
In TiddlyWiki, tags are highly dynamic but during the static generation, tags turn out as buttons with no action. This thus needs some correcting.
Probing into TiddlyWiki, I figured the displaying of tags is controlled by the shadow tiddler $:/core/ui/TagTemplate
(local) (v5.1.8) (current TW).
There, it's not too hard to locate the tag button. I thus I just replaced the button widget
<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-tag-label" style=<<tag-styles>>>
<$transclude tiddler={{!!icon}}/> <$view field="title" format="text" />
</$button>
with a link widget that links to the tiddler corresponding to the tag.
<!-- replacing the tag button with a link -->
<$set name="taglinksto" value={{!!title}}>
<span class="tc-btn-invisible tc-tag-label" style=<<tag-styles>> >
<$link to=<<taglinksto>> >
<$transclude tiddler={{!!icon}}/> <$view field="title" format="text" />
</$link>
</span>
</$set>
Of course, modifying this shadow tiddler will also affect the TiddlyWiki used for editing this site and we don't really want that. So one solution I use is to create the above modification in a separate file (called static_tags
) and then override the tiddler when invoking the static generation (you ought to create a shell script for it)...
# "overriding" shadow tiddler
cp -i static_tags tiddlers/\$__core_ui_TagTemplate.tid
tiddliwiki --rendertiddlers ... # static generation
rm -f tiddlers/\$__core_ui_TagTemplate.tid #clean up
This might not be very elegant but it is good enough.