Skip to content

Tiddlywiki Static Site Generation

References

Introduction

For a lightweight, information holding website, a Static Site Generator (SSG) is the way to go (IMHO). There are a lot of great SSG's, such as Hugo, Jekyll, etc. However, as I'm a heavy user of Tiddlywiki for information management, it only made sense to use the SSG that is built into Tiddlywiki.

Implementation

I won't go into the details of using the Tiddlywiki SSG here; that is well covered in the reference links provided. However, I will provide a bit of information about how I implemented my workflow, and provide the shell script I use to build the static site web pages and deploy the pages to my internal development web server. I'll also provide the shell script that I use for deploying the web pages from the dev web server to the production web server.

I use Kubernetes in my home lab, so both the source tiddlywiki server and the development web server are hosted in containers on my cluster.

Static page build and deployment to dev server

$ cat build_static_website.sh 
#!/bin/bash

wikiPath='/mnt/k8s-storage/wikis/website-wiki/mywiki'
devWebsite='/mnt/k8s-storage/delfax/website'

cd ${wikiPath}

sudo tiddlywiki --rendertiddlers [!is[system]!tag[Draft]] $:/rdr231/templates/static.tiddler.html static text/plain --rendertiddler $:/rdr231/templates/static.template.css static/static.css text/plain
sudo rsync -avv --delete ${wikiPath}/output/static/ ${devWebsite}/
sudo chmod -R o+r ${devWebsite}/*

Deployment to prod server

$ cat deploy_static_website.sh 

#!/bin/bash

devWebsite='/mnt/k8s-storage/delfax/website'
sitePath='/home/rmorrow/docker/docker_nginx-radar231.com/radar231.com'
siteFQDN='radar231.com'

rsync -avv --delete -e "ssh -p 50022" ${devWebsite}/ ${siteFQDN}:${sitePath}/html/
ssh -p 50022 ${siteFQDN} cp -r ${sitePath}/images ${sitePath}/html/

Created: 2021-06-06 16:12
Last update: 2021-09-04 16:28