In Spring 2012, I decided it was time to revise my personal website. I ended up writing a very lightweight content management system.


Each page is written in Markdown. To see the Markdown version of a page, replace .html with .md in the URL. For example, here is this page's Markdown source.

A small Python script named webgen searches through the directory structure for files with the .md extension. It converts each into HTML, then adds a standard header and footer.

Finally, the entire website is stored as a Git repository, based on this guide. A server-side post-commit hook runs webgen whenever changes are pushed. Only the Markdown files are versioned; the HTML files are regenerated whenever their dependancies change.


As of May 2014, webgen is no more: 130 lines of Python were replaced by a 25-line Makefile. In my non-scientific testing, it runs about 3x faster (with -j8).