Prologue: a blog is born


The subtitle for this post should be either 'keep it simple' or 'release often'.

A few years ago I purchased this domain name with the intention of using it as my space on the web; various small sites have come and gone, but is has mostly sat unused.

This post is mostly a quick retrospective on the journey it took to get here.

For a while the site ran of werc which is written in rc, this means it required half of another operating system in order to run.

Werc worked (heh) for a while, however I found it quite clunky. I wanted to test-generate my site before deploying it and werc didn't make this easy. I thought I could do better.

So I decided to try write a replacement.

As simple as possible

My first attempt was was a small shell script I named 'wikify'; it took a tree of files and creates a matching tree with automagically generated index pages and all the markdown files converted to html.

Wikify worked pretty well, but soon I noticed it didn't cope with spaces in filenames due to how sh handles lists (hint: a string with $IFS separating each element, $IFS defaults to space) and although there are ways around it, I found none of them satisfactory.

To this day is still used in my 'personal wiki' (a git repo I use for recording interesting things I learn), but it isn't what I really wanted for my website and doesn't meet the needs of a blog.

But no simpler

Sitting at work well after I should have gone home, I felt like trying to throw around some ideas for a blog, so I started with some static html documents and the most basic css I could, eventually I had something passable.

Wanting to see how far I could get I began scattering <!-- POST TITLE -->, <!-- POST DATE -->, <!-- POST CONTENT -->, and <!-- INDEX CONTENT --> around the html 'templates'.

80 lines of Perl later, and by the power of Text::Markdown, I now have something resembling a blog.

You can view the mess on github.

I have it setup as a gitolite post-receive hook so anytime I push my repository of markdown files the site is regenerated, and I can easily test-generate a local copy by running smirk directly.