Because I'm so good in procrastinating things, I never got around to do something I have been planing for a long time: Ditch using Movable Type, and develop an independent backend for this site.

First I had planned to go for a simple backend written in PHP with a web interface to write new postings. No big deal, since I do the same thing for a living from time to time. At one point I realized that writing texts longer than a few words in web browsers sucks so much that it makes my eyes bleed. This was when the idea of building a fancy offline editing thingie occured on the horizon: Ideally I wanted to be able to write posting in Emacs and publish them with a single keystroke. Both Tim Bray and Norman Walsh seem to be blogging this way, and quite obviously it works for them. And hey, if it works for the big animals, it'll work for me, too.

Since I liked the offline thing more and more I decided to give it a chance. It was always beyond question that I would use Emacs for writing the source postings. What was still to be determined was the source format and the way to deploy the sources to the web.

The source, luke

Let's get the source format right first: I opted for a variation of XHTML, which seemed like the best tradeoff between semantically heavy formats like DocBook and simple HTML. Basically the source files are plain XHTML but with some metadata attached:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  
  <info>
    <title>Relaunched</title>
    <category></category>

    <date>2005-04-16</date>
    <time>18:10:20</time>

    <abstract>
      In the past days I revamped this site.  And today I'm going to 
      tell you all the glorious details.
    </abstract>

    <author>
     <firstname>Martin</firstname>
     <surname>Jansen</surname>
    </author>
  </info>

  <body>
    <p>
      Because I'm so good in procrastinating things, I never got around 
      to do something I have been planing for a long time: Ditch using 
      Movable Type, and develop an independent backend for this site.
    </p>

    [...]
    

The <head /> part has been replaced with <info />, which inherits the title tag and adds some more information. The tag names basically speak for themselves.

The buzzword-compatible deploying strategey

Now for the hard part: Transforming the source files into single XHTML files, RSS feeds, and archive indexes.

My first idea was to go for some PHP code combined with a bit of Smarty magic. For a variety of reasons I quickly disliked this and had a look at how Norman Walsh solved the problem. Now if you've never heard of Norman you should know that he is the man who invented DocBook XML and probably knows more about RDF, XSLT and XML than anyone else on our planet. I believe that this is the main reason why his infrastructure is so (please forgive me for channeling the Dooce) FUCKING COMPLEX.

Don't get me wrong: His stylesheets are pure beauty for people eating XSLT for breakfast, and they are probably the best tools for the job, but heavy XSLT is like black magic for me at the moment (though I believe I'm learning quickly).

That's why I started writing my own XSLT stylesheets. And it seems like it worked. Yay!

Industrial strength technology

In addition to the neato XSL stuff I'm using some GNU make magic and some bytes of Python code here and there to automate things nicely. I think I'll publish the source code at some point, but I doubt it is of much use for anybody except me.

I'm managing the whole site in a Subversion repository. This is not only nice for making backups, but it also allows me to go back to a previous version in case I make any mistakes.

After the XSLT heavy-lifting Tidy is used to transform the glibberish returned by xsltproc into readable (who actually needs this?) XHTML.

I'm writing all new postings on some random machine (thanks to Subversion this is either the desktop at my place, my notebook, or any other machine connected to the Internet and with decent support for my tool-chain). The excellent Sitecopy takes care of synchronizing the local sources with the production system at the datacenter.

At one point I decided to ditch support for comments completely. If you want to comment on something I've written, feel free to drop me a mail or post it on your weblog (you do have one, no?) and send me a TrackBack. (Actually a TrackBack feature for site is yet to be implemented.)

And in case you were wondering: All the stuff from the old weblog still exists. Find it over there. Most URLs from the previous version of the site should still be working.

Written on 2005-07-02 19:58:20.