Publishing TW to the web from node.js

OK so my attempts to create a static html version of my node.js wiki were unsuccesful.

Is there a method to publish a node.js version of a complete TW to a web host? As it stands the wiki is currently a colection of tid and json files. I don’t seem to find specific help pages for this on the https://tiddlywiki.com site.

Of various ‘demo’ versions of TW that are around are these served from single html file as I ideally I want to stick with my node.js version?

Thanks.

Hi @myfta to publish an interactive wiki as a single HTML file from Node.js, use the following command to generate the HTML file:

tiddlywiki editions/tw5.com-server/ --render '.' 'index.html' 'text/plain' '$:/core/save/all' 'publishFilter' '-[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]]'
1 Like

Ran that, but it generates a completely empty index.html file … ?

Ah, I guess it’s a Windows issue, change to double quotes:

tiddlywiki --render "." "index.html" "text/plain" "$:/core/save/all" "publishFilter" "-[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]]"

Apologies, there is a reason that try to use double quotes in examples!

Can this be added to the help files somewhere on tiddlywiki.com? It’s not clear where this should be placed.

2 Likes

@jeremyruston
Now that I have my images in a seperate folder \files see _canonical_uri field fails

How do I modify the --render command above so that the images are stored seperate to the html in the \output\index.html file?

If you’re using the files folder to serve images that you are referencing via _canonical_uri fields, then all you need to do is copy the entire files folder and distribute it alongside the HTML file.

The images in the files folder are not part of the wiki, and so cannot be accessed by the render command.

2 Likes

Thank you. I didn’t imagine a “lift and shift” was the way to go!