Blosxom rocks
I’ve been hearing a few good things about Blosxom recently, so a few days ago I decided to see what all the fuss was about. It’s a blogging tool, but it’s a very different species from the average system. Firstly, it’s only 282 lines of Perl (of which only 135 are actual code). Secondly, rather than having a web interface of some sort to add entries it runs entirely from the file system. You specify a data directory, then create entries by dropping .txt files in to that directory using your favourite text editor. The first line of each file is the title, the rest of the file is the entry, and the entry’s date is taken from the last-modified time of the file.
So far, so straight forward. Where it gets really clever is the template and category systems. To customise your basic blog you drop a head.html and foot.html file in to your data directory. To customise the display of entries, drop in a story.html file with a few simple replacement variables in it. Categories are again handled by the filesystem—you create directories (or nested subdirectories) for the categories you want and simply drop entries in to those directories instead of the top one.
Blosxom supports RSS straight out of the box, and can support any custom format you could possibly want thanks to its support for “flavours”—explained on the site. Pretty good for 150 lines of code!
I doubt I’ll switch over to using Blosxom myself, but the cleanness of its design combined with the ease with which it can be extended (Blosxom 2.0 has a very promising plugin architecture) make it an excellent choice for aspiring geek-bloggers. If I’d known about it before I started this blog I may well have used it (or a variant) instead of rolling my own. l.m.orchard is building Decafbad 2.0 around it and has already done some pretty exciting things.
I really like the approach of relying on the filesystem to do as much of the work as possible. I suppose most web developers who start with PHP (myself included) get stuck in to mySQL databases straight away and never realise quite how much you can do with a bunch of simple text files.
Ben Margolin - 13th March 2003 08:07 - #
Good points. Caching is already implemented - I forgot to mention it, but blosxom come swith the ability to generate your blog as static HTML files rather than serving it dynamically. As for searching, it could be built as an external service using something like htdig. Blosxom definitely isn't the perfect solution (there's no way of elegantly supporting one entry in multiple categories for example) but it does an incredibly good job considering its size and simplicity.
Simon Willison - 13th March 2003 08:53 - #
Micah - 13th March 2003 11:17 - #
Neat - I hadn't thought of that.
The Blosxom site mentions that it's great for providing blogs to multiple users - just set up a new directory for each user. Thinking about it, you could have a single global install of Blosxom and symlink directories in the global Blosxom data directory to directories in each user's home page, allowing them to update their blog by dropping files in their ~username/blog directory.
Simon Willison - 13th March 2003 12:40 - #
minghong - 12th July 2004 09:12 - #