1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-13 22:33:18 +00:00

Add build targets to server edition

Define for the server edition the same build targets as for the empty

edition, but using the correct template so that the "offline" version

(target "index") works correctly when accessed via HTTP. With this,

`tiddlywiki --build index` is equivalent to the save button.



While the process of setting up TiddlyWiki on Node.js is well documented

and easy enough, the options for  publishing such a wiki to an offline

version (scriptably, e.g. for push-to-deploy setups) are decidedly

non-obvious. With the added build steps, the user only needs to know

three simple commands:



tiddlywiki --init server

tiddlywiki --server

tiddlywiki --build index



and optionally



tiddlywiki --build static
This commit is contained in:
nome 2016-04-03 21:22:11 +02:00 committed by Jeremy Ruston
parent 0dd3e9c144
commit 37823f64e9
2 changed files with 20 additions and 2 deletions

View File

@ -8,5 +8,19 @@
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
]
],
"build": {
"index": [
"--rendertiddler","$:/plugins/tiddlywiki/tiddlyweb/save/offline","index.html","text/plain"],
"externalimages": [
"--savetiddlers","[is[image]]","images",
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
"--setfield","[is[image]]","text","","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/tiddlyweb/save/offline","externalimages.html","text/plain"],
"static": [
"--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain",
"--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
"--rendertiddler","$:/core/templates/static.template.css","static/static.css","text/plain",
"--rendertiddlers","[!is[system]]","$:/core/templates/static.tiddler.html","static","text/plain"]
}
}

View File

@ -17,9 +17,13 @@ type: text/vnd.tiddlywiki
## `tiddlywiki mynewwiki --server` to start TiddlyWiki
## Visit http://127.0.0.1:8080/ in your browser
## Try editing and creating tiddlers
# Optionally, make an offline copy:
#* click the {{$:/core/images/save-button}} ''Save changes'' button in the sidebar, ''OR''
#* `tiddlywiki --build index`
The `-g` flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it.
If you are using Debian or Debian-based Linux and you are reciving a `node: command not found` error though node.js package is installed, you may need to create a symbolic link between `nodejs` and `node`. Consult your distro's manual and `whereis` to correctly create a link. See github [[issue 1434|http://github.com/Jermolene/TiddlyWiki5/issues/1434]]
Example Debian v8.0: `sudo ln -s /usr/bin/nodejs /usr/bin/node`
Example Debian v8.0: `sudo ln -s /usr/bin/nodejs /usr/bin/node`