Remove .html when linking to pages

77 views
Skip to first unread message

Anne-Laure Le Cunff

unread,
Apr 13, 2020, 3:35:17 PM4/13/20
to TiddlyWiki
Hi everyone,

I'm going to host one of my wikis on GitHub pages. It's working great so far, except that each page links to filnemame.html, which doesn't look nice. Is there a way to avoid this when exporting to a static website?

I cannot use .htaccess on github pages, so would need the URLs in the <a href="#"> themselves to look like https://tiddlywiki.com/filename instead of https://tiddlywiki.com/filename.html

Github already supports displaying the content of https://tiddlywiki.com/filename.html when accessed from https://tiddlywiki.com/filename

Thank you!
Anne-Laure.

Riz

unread,
Apr 13, 2020, 8:39:27 PM4/13/20
to TiddlyWiki
Create a folder named filename
Keep your html file inside it and rename it index.html

Now you can link to it as www.mysite.com/filename

Anne-Laure Le Cunff

unread,
Apr 14, 2020, 3:25:50 AM4/14/20
to TiddlyWiki
Thanks! That's the only solution I found but it's very manual and not best practice either.

Jeremy Ruston

unread,
Apr 14, 2020, 5:42:08 AM4/14/20
to TiddlyWiki
Hi Anne-Laure

I'm going to host one of my wikis on GitHub pages. It's working great so far, except that each page links to filnemame.html, which doesn't look nice. Is there a way to avoid this when exporting to a static website?

Historically we use the HTML extension for static exports because some browsers get confused viewing HTML files without an extension from a file:// URI.

You can change things by taking a copy of the template $:/core/templates/static.tiddler.html and changing the first line from:

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

to:

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

To render tiddlers using that template, you’d use a command like this, substituting the name of your modified template for the last argument.

--render "[!is[system]]" "[encodeuricomponent[]]" "text/html" "$:/core/templates/static.tiddler.html”

I cannot use .htaccess on github pages, so would need the URLs in the <a href="#"> themselves to look like https://tiddlywiki.com/filename instead of https://tiddlywiki.com/filename.html

Github already supports displaying the content of https://tiddlywiki.com/filename.html when accessed from https://tiddlywiki.com/filename

Awesome, I had no idea. Just tested it with https://tiddlywiki.com/index which happily behaves as if it was https://tiddlywiki.com/index.html.

Best wishes

Jeremy.


Thank you!
Anne-Laure.

--
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/65635e04-6d16-417d-80a8-843298ecdac4%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages