Problem generating static sites

Hello everyone.

I am trying to export a wiki as static and although I succeed I see some errors.
The commands I use to generate the static site are these:

tiddlywiki --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain

tiddlywiki --rendertiddler $:/core/templates/static.template.html static.html text/plain

tiddlywiki --rendertiddler $:/core/templates/static.template.css static/static.css text/plain

What doesn’t work out well for me is that in the sidebar the tabs are not accessible and that when I select a tiddler it takes up the entire screen and hides the sidebar. The corresponding icons do not appear within the tiddler itself either, especially the close one.

Does anyone know how to configure the export so that it is faithful to the original wiki?

Thank you.

Hello.
I’ve been testing a little and in the end I’ve managed to get the static site to show me the images from the original wiki that didn’t appear at first.
But I still don’t know how to make the sidebar tabs functional and that the tiddlers have an icon to close them and don’t take up the entire screen. I’ve searched the forum but haven’t been able to find anything…

I think you’re trying something that’s not really going to work. The static generation is intended to run without JavaScript, which means that although you can make it look a fair bit like the normal look (https://tiddlywiki.com/static.html), the sidebar does not function at all, and the links are to static pages without that sidebar. You can also get a version with all the tiddlers in alphabetic order (https://tiddlywiki.com/alltiddlers.html), but I personally see little use for that. There is more information in https://tiddlywiki.com/static/Generating%20Static%20Sites%20with%20TiddlyWiki.html, which also shows what the normal static process is meant to generate.

If you still want more, I’d recommend reading this thread, especially Dave Gifford’s advice: Easy method of setting up a static site?.

But I would want to ask if you have a strong need for more. The main site uses a static site generator to make it easier for indexers to find the content (SEO), but most users will likely eventually follow a link from there back to the main site (it’s at the top of every page.) If that’s your goal, then you might follow the same pattern.

Hi Scott.

Thanks for the clarification, I’ve been checking the Tiddlywiki static website and it does what’s wrong with me. I thought I was doing something wrong…
Well, then I’ll have to make a page with a TOC to navigate among the tiddlers.

All the best.

If you name it “index”, it will generate as “index.html”, and that will be the default page at your root url for most hosting systems. https://mystaticwiki.example.com/ will generally be served with the index.html at the root of your deployment.

2 Likes

I just tried doing this at work on a Windows box and I noticed that the instructions are slightly wrong there. The first command looks like this

tiddlywiki wikipath --rendertiddlers '[!is[system]]' $:/core/templates/static.tiddler.html static text/plain

For Windows, I needed to remove the single quotes.

tiddlywiki wikipath --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain

I’ll check later from home to see if double-quotes would work everywhere.

1 Like

The same thing happened to me, and I came to the same solution.

Thank you.

Would it be possible that when the static pages are generated, a link appears at the bottom to return directly to the home page???

It certainly must be, because the main static site does that (at the top.) But someone more knowledgeable than I might have to tell you how it’s done.

1 Like

A banner can be added to the static export by defining a tiddler $:/StaticBanner. It is rendered at the top of all the core static templates. The tiddlywiki.com edititon defines the static banner as follows:

<div class="tc-static-alert"><div class="tc-static-alert-inner">This page is part of a static HTML representation of the ~TiddlyWiki at https://tiddlywiki.com/</div></div>

I notice that there is no documentation about this on tiddlywiki.com, contributions would be welcome here.

1 Like