Posted: 7th March 2013

So, I'm looking for a job, I also have a domain and a VPS (hosted by the lovely guys at bitfolk). I should do something with this (rather than, say, actually look for a job). The plan was simple:

  1. Write a basic parser to generate a static page
  2. Create a website using the parser
  3. ...
  4. Profit!

What actually happened was that I skipped 1, got stuck on 2 and I'm hoping 3 & 4 will take care of themselves.

Originally I'd intended to build something very simple using Jinja. Luckily (for my spare time) my friend Ben beat me to it.

Based on Jekyll (which is written in Ruby), Tachikoma, is a nice little python program that converts pages written in html/markdown into static websites. This may not sound very useful (why convert HTML into HTML?) but by some nice use of layouts and Jinja2 you can remove almost all of the boiler plate. In fact the boiler plate to generate this page is only 9 lines, for comparison the base layout file is 87 lines.

The design that Ben used is pretty simple: layouts contain Jinja2 blocks and every page of content has a short YAML header that specifies a layout the rest of the content then fills in which ever blocks its layout specifies (e.g. 'body', 'right side'). The header can also contain other metadata, for example the summaries you'll see on the blog page.

It took some tweaking and tidying in order to get Tachikoma working as I wanted (the original version couldn't use blocks) and I followed the crowd in using the Bootstrap CSS but, I hope you'll agree, the result is pretty good (especially for a first real site).