Offline CMS

Published on

One of the things I’ve been up to this summer is website design. I’m being paid to design a website for a local primary school in Doncaster. Now normally I’d use some sort of CMS to manage the site, but in this case this is impossible, as the webspace the school has doesn’t have any server-side scripting support.

So to accomplish the task without having to maintain a million HTML files with lots of duplicate template code, I’ve written a simple offline CMS in Bash, which takes some template files (in the form of a shell script which defines some variables) puts that into a template, and inserts a navigation bar.

It’s pretty simple, but it took me a few hours, so if anyone ever needs to do the same, feel free to use mine. I’m licensing it under BSD, so feel free to enhance it if you wish. The Bash script generate.sh has the template and config in it (just move the variables and the sitemap backticks), and the Tcl script sitemap.tcl is the logic for generating the navigation bar. The file sample contains a sample format for a template file (all your files must end in .tmpl to be considered. The order of the pages in the navigation bars is decided by the name of the .tmpl file, so you can call them 00index.tmpl 01subpage.tmpl to have a specific ordering in your navigation bars)

Download Offline CMS