Alternate ways of rendering static urls

Hello!

I use TiddlyWiki to generate a public second-brain-like website. It is all static files, and I do it via the known static template strategy (with a few non-important changes).

The urls are generated in a very particular way (as depicted here: How do I avoid double URL encoding when rendering URLs in my website?).

I understand this is expected behaviour for maximum compatibility (and that TW should not be expected to work as a fully-functional static website generator). I do wonder, however, if there are alternate ways of mapping each tiddler title to a universally compatible .html file name; something that would bring it closer to the usual standard of url formatting ā€” - instead of spaces, etc ā€” albeit probably at the expense of additional work in linking the static pages.

Thank you!

EDIT: while working on a unrelated issue, I just noticed a definition at the top of the template:

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

Iā€™ll try fiddling with this!

This work, which I believe is scheduled for the next version, speaks to how we might handle urls more cleanly:

Simplify permalinks by CrossEye Ā· Pull Request #7990 Ā· Jermolene/TiddlyWiki5 Ā· GitHub

I donā€™t know if it needs to change to handle static site generation. I never considered that.

2 Likes

I Think it is reasonable to make use of tiddlywiki ā€œto work as a fully-functional static website generatorā€. It uses a simple template to generate pages that can be modified to meet various requirements. You could even modify it to generate pages from different page templates, make non static pages and more.

  • However I always think why not make use of full tiddlywikis with there interactive features?
  • Tiddlywiki can be used to generate other tiddlywikis, for example see the innerwiki plugin.
1 Like

Thank you, @Scott_Sauyet, for the link! In the meantime, I also found your own topic on this (URL encoding using a `+` instead of `%20` for a space - #27 by TW_Tones) which I wonder how I did not find earlier? Itā€™s a long discussion, so Iā€™ll get to it tomorrow.

@TW_Tones, I did not know about innerwiki, which is interesting ā€“ but indeed Iā€™d rather, for now, have it all be static pages (I think thereā€™s less load on the user, itā€™s overall simpler, and perfectly meets my needs at this moment).

Yesterday I found about the

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

line on top of the static exporter template. It led me here, but this lets me, at most, go from double encoded to single encoded urls. My point is the same as Scottā€™s above: Iā€™d rather have + instead of %2520, even if it entails some extra work ensuring there wonā€™t be tiddler title issues.

So, I am now onto finding where lies the definition of $uri_doubleencoded$, so I can try to fiddle with it.

Thank you both for the replies!

When using TW to export to a static site I ended up using a solution TW Jones mentions in one of the threads you referenced:

The title of the wiki is the ā€˜slugā€™ - no-caps-and-no-spaces. Then I have a field called pageTitle where I put the ā€œofficialā€ title - No Caps and No Spaces. Using the ViewTemplate I then put the pageTitle in place of the tiddler title.

I realize this may be something very difficult to go back and do with a great deal of content but it works great when starting a new project.

2 Likes