Static render suppress URI encode

40 views
Skip to first unread message

Tristan

unread,
Jan 16, 2022, 5:24:02 AM1/16/22
to TiddlyWiki
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?

Tristan

unread,
Jan 25, 2022, 10:31:47 AM1/25/22
to TiddlyWiki

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?

Jeremy Ruston

unread,
Jan 25, 2022, 6:18:03 PM1/25/22
to TiddlyWiki Group
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:


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

Best wishes

Jeremy



-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/426bee7b-b0bf-481a-a637-d7c7c2259c83n%40googlegroups.com.

Tristan

unread,
Jan 26, 2022, 2:46:32 PM1/26/22
to TiddlyWiki
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 :D
Reply all
Reply to author
Forward
0 new messages