Build A Better Blog
I’ve been not-too-enamoured with Geeklog for quite a while now, and I’ve been experimenting with a lot of different blog engines. Recently, I was pointed at WordPress, a PHP/MySQL blog engine. I like quite a bit, as it implements a lot of the Gee-Whiz!! features I am looking for without the overhead of a .NET or Java-based engine. So I started playing with making it work the way I wanted.
And I came to the conclusion that I need to write my own blog engine. The problem with every blog engine that I have found is that they are all template-driven. Don’t get me wrong, templates are all fine and dandy. They make it easy for people with very simple HTML skills to customize things in simple ways. However, they make this happen by embedding calls to pre-defined functions within the templates, such as get_topic_list()
or get_front_page_entries()
. These functions are hard-coded to produce output that is appropriate for the general look-and-feel the designers have chosen. However, it is very difficult to do anything very different than the original design for two reasons. First, these functions very often dump HTML directly into the HTTP output stream. Second, if you want to customize these functions yourself, you risk giving yourself a huge headache when it comes time to upgrade the software, as the official version will not have your changes.
My proposed solution is to use an XML pipeline, such as Apache Cocoon, to allow for extensible transformations to be hooked into the rendering pipeline. By using XSLT to transform the blog data as it comes down the pipeline, you can do virtually anything to your site. The advantage over the existing system, however, is that XSLT is inherently tolerant of inconsistencies in the data it processes. It simply ignores anything it doesn’t understand and does its thing. With this system, you could upgrade the entire platform underneath you without losing your customizations, except in the case of a massive change to the data format.
Now, I don’t really want to write an entire blog engine. I’m thinking of taking something like Roller and just making my own rendering engine out of Cocoon that reads from the same database. That way I get all the editing, management, and web service APIs for free. Now if I can just find the time…