New Year, New Platform - from Radiant to Jekyll
With the dawn of 2010, I decided it was time to move away from Radiant as the CMS for most of the sites I host and maintain. Radiant does a reasonable job, with a nice simple user interface non-technical users can grasp quite easily, but it takes a great deal of memory and slows down the site being served with all the overhead of going from the web server, through Mongrel or FastCGI into Radiant then rummaging around in MySQL to retrieve all the page components.
Radiant’s caching helped – and, in conjunction with Lighttpd’s mod_magnet facility, I was able to add a simple Lua script which would turn any recent cache hit into a simple static content delivery through Lighttpd, bypassing Radiant entirely – but for sites with very infrequent changes, having over a hundred megabytes (on a server with 360Mb total!) tied up in a CMS whose features weren’t used from one week to the next seemed silly.
In particular, after an unexpected reboot of the server which holds this site and a few others, the two Radiant instances each took over 100 Mb of RAM – which, on a server with 360 Mb total and several other services active, meant hitting swap and several minutes of disk thrashing before the sites were live again.
At the time, I had one Radiant instance hosting the SUE-MoT project website, with a second hosting the remaining sites including this one. With the SUE-MoT project having officially ended some months earlier, there would be no significant updates – perhaps no updates at all – this site was an easy one to migrate: a simple wget command was enough, with a second to retrieve the current sitemap XML file.
For the other sites, more actively maintained, it’s a little more difficult. I decided to migrate this site second; rather than taking a static snapshot as for SUE-MoT, I wanted something that would keep updates nice and simple. A few options came to mind: rebuilding the pages using something like SSI to pull in the common elements, or running the files through a pre-processor of some sort to generate static content to upload.
Enter Jekyll: a simple Ruby tool for generating static content from templates and text files, with Textile support, so I could simply copy most of my content directly from Radiant into Jekyll files, layouts to simplify editing common elements the same way I could with Radiant – all that’s missing is the dynamic content (recursion etc) with Radiant’s inline tags starting <r:.
It isn’t quite perfect – very limited support for generating content such as page lists, and documentation which leaves almost everything to be desired – but it will do the job I need for now. In the longer term, I’ll find or develop a replacement, probably not using Ruby and hopefully having at least basic documentation for all the features. The SUE-MoT site relied on simple Radiant iteration and conditional statements; the Jekyll documentation suggests such things exist but fails to give enough information to use them, which forced me to use wget instead. Fortunately, this site never used those – just a hard-wired list of headings in the page template – and there are clever ways to achieve similar results quite elegantly with CSS selectors which I will use and document in the near future.
blog comments powered by Disqus