Easy method of setting up a static site?

Perhaps I’m being lazy but I’m looking for the easiest way of setting up a static wiki on my existing webhost. I don’t need any ability for me edit site online, just serve the offline wiki as a set of webpages. Happy to FTP from tine to time for updates.

Most of the solutions to this question online and here involve using node.js. Is there a simpler way that will just work?

Thanks

2 Likes

There are several.

My approach is dumb. Any tiddler can be saved as a web page.

BUT, the man who you likely want to talk to is @DaveGifford who has done a lot practically with publishing his wikis static.

A comment, TT

Unless you have a need such as a very large wiki, perhaps just placing the whole wiki online with say a read only mode is best, then people can search and use other navigation.

  • Have you tried the export all button on the Page Controls? it makes a single static html of all tidders.

Also are there just a few pages, or do you need all tiddlers?

The reason people use node for this, is you can run a command that generates all the tiddlers in a batch, however with some smart templates similar to the one that exports static tiddlers, or even saves tiddlywiki normally, you could export what ever you like, in whatever format you like.

  • One smart way to do this on a single file wiki is to use a template for the wiki, or tiddlers that puts them in a zip file (see zip plugin). You can then save and FTP the zipfile and expand it on your host (does not handle deletes, so you may need to delete all host files first.

I would be happy to try creating something for you if you can spell out a little more what you expect and why.

2 Likes

This is what I do for my statics at : Índice central giffmex

I use node.js to edit the file. If you are not familiar with node.js, I can assure you that after the initial setup process and the first couple of times opening and editing in node.js, the weird command prompt process becomes second nature If not, you can just write yourself out the two or three instructions you need just to remind you. Use Anne-Laure’s instructions and ask at this forum if you get stuck: How to use TiddlyWiki as a static website generator in 3 steps - Ness Labs

Then after you edit your file, export all to static html, then select your static html folders in Windows explorer or the equivalent in your OS, and save to your online folder via FTP, and choose in FTP to overwrite the existing files with the new ones. It seems like overkill to upload ALL your statics every time, but that is easier than finding just the tiddler statics you exported on a given day and uploading those individually.

If you have custom CSS and/or Google fonts you may find you need to tweak some of the following since the templates don’t always display properly.

$:/core/templates/exporters/StaticRiver
$:/core/templates/exporters/StaticRiver/Content
$:/core/templates/server/static.tiddler.html
$:/core/templates/static.tiddler.html

Anyway, that is what I do. Hope that is helpful.

4 Likes

Thank you @DaveGifford, I was browsing your sites just before you replied. Impressed, and you’ve convinced me node.js is the proper and easiest way to do ir!

2 Likes

@myfta

If you started using Tiddlywiki on Node.JS, then exporting to a static site is quite easy, no matter what operating system you use

Easy Method

  1. Create your new wiki (if you have one skip this step)

For example to create a new wiki in mywiki folder issue the below command from command window (shell)

tiddlywiki mywiki --init server
  1. Edit and add your contents (if you have created your notes, skip this step)
    From the command window (shell) start your wiki
tiddlywiki mywiki --listen

in browser open your wiki and add your contents (normally it is http://127.0.0.1:8080

  1. Export to static site
    From the command window (shell) export your wiki to static site
tiddlywiki mywiki --build static

That is all!

Now your static site is in mywiki/output/static

So, TiddlyWiki on Node.JS already has everything to create a static site, no hassle, no extra tools are needed.

Side note:
Gatha Studio in its new release has a feature to publish from single file Tiddlywiki to static site. There is no Node.JS requirement. I have not published it yet, It needs some polishing and documentation before public release!

3 Likes

@Mohammad that’s really helpful. Thanks.

If you have not yet used Node the quickest and easiest access is using bob.exe and from memory it also has single file export tools as well.

1 Like

OK, all the node.js and TW setup is fine. Now a question, my wiki which I can work on as normal is at http://127.0.0.1:8080/ Where are the actual files located. I’m on Windows and have my disk partitioned C: for system and D: for my_data. I really would like the wiki data on my D: drive. Can that be done?

Where is you wiki folder? Look inside it and you will have a tiddlers folder. Everything is in that folder.

Important: Tiddlywiki on Node.JS is ALMOST portable like its single html file, copy the folder on a thumb drive and you can use it on any other computer has TW+Node.JS

Side note: Why almost? If you have customized setup, like many third parties plugins/themes, then on the target machine with TW+Node.JS you need to have those plugins/themes

The problem is I cannot locate the TW file(s) on my file system.

I ran these two commands as per the instructions:
C:\Users\graha>tiddlywiki myfirstwiki --init server

C:\Users\graha>tiddlywiki myfirstwiki --listen

and all it see in my address bar is
http://127.0.0.1:8080/

I can create and save Tiddlers and the there is confirmation in the command terminal.

so where exactly are the files?

C:\Users\graha\myfirstwiki

It must have been some temporary glitch. I created another Tiddler and all appeared in my filesystem. Thanks.

Many thanks for these clear instructions.

Unfortunately I get an error

‘“node”’ is not recognized as an internal or external command, operable program or batch file.

Can anyone say what has caused this?
Thanks

If you haven’t already installed Node.js, you need to do that before using any of these instructions. You can download it from https://nodejs.org/.

If you have already downloaded and successfully installed it, you will need to figure out how to add it to your PATH for your operating system, or make a direct reference to it – that is, where the command starts node, you will need to do replace it with something like /path/to/node. On Windows that might be something like C:\Program Files\nodejs\node. On Linux or Mac it might be /usr/local/nodejs/bin/node.

1 Like

Thank you for responding…

The wiki runs perfectly when I type

tiddlywiki mywiki --listen

And I can access it from my browser.

It is when I try to create the static version using

tiddlywiki mywiki --build static

That I get the error.

Oh, that’s more bizarre; it sounds like something that simply shouldn’t happen. I think you will have to wait to hear from someone who knows the server-side code better. Good luck.

Hi. I solved it by starting the terminal in the nodejs folder and adding the name of the wiki to the command.

Thanks for your help

1 Like

Hello everyone.
Is there any way to export together with the html file the attached documents on the wiki? I mean images or videos? Thank you. Is there any way to export together with the html file the attached documents on the wiki? I mean images or videos?
Thank you