[tw5] Static render suppress URI encode

To make prettier permalinks for my setup and making the URL hackable I changed my render command. All files do get created but internal links are still URI encoded and therefore do no longer work:

tiddlywiki . --render “[!is[system]]” “” “text/plain” “$:/core/templates/static.tiddler.html” --render “$:/core/templates/static.template.css” “static.css” “text/plain”

Tiddler 2022/010 results in a file 010.html inside 2022. But all links still use default 2022%252F010%252F0.html which breaks all internal links. I think I have to modify tv-wikilink-template in $:/core/templates/static.tiddler.html but how?

1 Like

Unfortunately I was not able to figure out how to influence the filename generation. My custom HTML template does not create anything other than the content. I could not find where in the saving process Tiddlywiki messes with my filenames so I could stop it and have it create a nested folder structure as intended.

Does anyone use TW as I static site generator and willing to chip in?

1 Like

Hi Tristran

The templates that we use in the core for static rendering generally include a definition of tv-wikilink-template at the top of the template. For example, $:/core/templates/static.tiddler.html starts with the following line:

\define tv-wikilink-template() $uri_doubleencoded$.html

If you’re using a custom template then you can modify that declaration according to the instructions here:

https://tiddlywiki.com/#tv-wikilink-template%20Variable

Alternatively, you can omit the definition from the template and instead specify the variable as part of the render command.

Best wishes

Jeremy

It worked! Thank you Jeremy!

I was banging my head against the table because I had it working a few years back and could not figure out how I did it back then :smiley: