1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-16 06:44:50 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/howtos/Generating Static Sites with TiddlyWiki.tid

38 lines
2.0 KiB
Plaintext
Raw Normal View History

2014-02-28 15:48:12 +00:00
created: 20130828190200000
modified: 20200421003440463
2014-09-12 15:05:37 +00:00
tags: [[TiddlyWiki on Node.js]]
2014-02-28 15:48:12 +00:00
title: Generating Static Sites with TiddlyWiki
type: text/vnd.tiddlywiki
TiddlyWiki5 can be used to generate static HTML representations of a TiddlyWiki that doesn't need JavaScript.
This process requires that TiddlyWiki be installed on Node.js on your local system. See [[Installing TiddlyWiki on Node.js]] for
details.
2014-02-28 15:48:12 +00:00
There is much flexibility in how the static HTML is generated. The following scenarios are all illustrated on https://tiddlywiki.com.
2014-02-28 15:48:12 +00:00
! Wiki Snapshots and Tiddler Snapshots
You can explore a static representation of the main TiddlyWiki site at https://tiddlywiki.com/static.html. That file is a static snapshot of the current DefaultTiddlers. Any tiddlers that it links to are referred to via URLs of the form `/static/HelloThere.html` that point to static snapshots of individual tiddlers. The tiddler HTML files reference a `static.css` stylesheet file.
2014-02-28 15:48:12 +00:00
The following commands are used to generate the sample static version of the TiddlyWiki5 site:
2014-02-28 15:48:12 +00:00
```
tiddlywiki wikipath --rendertiddlers '[!is[system]]' $:/core/templates/static.tiddler.html static text/plain
tiddlywiki wikipath --rendertiddler $:/core/templates/static.template.html static.html text/plain
tiddlywiki wikipath --rendertiddler $:/core/templates/static.template.css static/static.css text/plain
2014-02-28 15:48:12 +00:00
```
2014-12-08 13:09:31 +00:00
The first RenderTiddlersCommand generates the HTML representations of individual tiddlers, the second RenderTiddlerCommand saves the static version of the DefaultTiddlers, and the final RenderTiddlerCommand saves the stylesheet. (All the files are placed in the `output` folder of the wiki folder).
2014-02-28 15:48:12 +00:00
! Wiki Snapshot with Internal Links
It is also possible to produce a single HTML file that contains static representations of tiddlers, and uses standard HTML anchor links to jump between them.
For example: https://tiddlywiki.com/alltiddlers.html
2014-02-28 15:48:12 +00:00
2014-10-17 15:29:27 +00:00
The example is built by the following commands:
2014-02-28 15:48:12 +00:00
```
--rendertiddler $:/core/templates/alltiddlers.template.html alltiddlers.html text/plain
2014-02-28 15:48:12 +00:00
```