Switching to Python

For a long time this blog has been a static site, generated using Octopress and a lot of custom tweaks to various plugins, libraries and themes that I've gathered along the way. I started using Octopress in May 2013, and looking at the git repo for the site, it looks like on 2013-06-10 I saw the light and started tracking revisions. Now I've embraced the change I foreshadowed at the start of my holiday, and moved to a python-based static site generator.

When I first looked up static site generators, I settled on Octopress because it was built on Jekyll, the most popular static site generator at the time, and added some good functionality around blogging specifically. It was written in ruby, which I had no idea about, but that was the same for pretty much all the other static site generators around then. I remember that it was painful to customise the theme - mostly due to my lack of modern CSS knowledge, including pre-processors like sass - so I just tweaked around the edges of the rendered CSS of the whiterspace theme and shipped it. I managed to cobble in a few plugins and get them working, and left it alone.

There were always niggles though. The rake syntax for creating new posts/pages was clumsy, and there were a few custom tags specific to Octopress/ruby that were neither markdown nor html. The full Octopress code had to live alongside the source documents for the blog. Being generally lazy, and not blogging that regularly, I just let it slide for a while. But once I started writing up my travel blog, I realised that there things I wanted to be included and easier to work with, such as tag clouds, image-heavy posts and category index pages. I also wanted to be able to one-step deploy to S3, in place of the current rsync deployment that I'm using in Octopress. From what I could see, the beta versions of Octopress 3 were very stable, and covered pretty much all of the features I wanted, in a neat modular, gem-based process.

But the changes were fairly major, and I would've had to do a fair bit of work to port across my existing blog. I figured that moving to something written in python would be a much better option than something written in ruby, since I've learnt python over the last couple of years, and I would be far more comfortable jumping in and hacking around things in python, especially since I'd already written some python scripts for tidying up metadata and bits and pieces within the blog sources.

I'd previously played with Pelican and Hyde, but I never really liked either of them. It didn't help that the default themes weren't that attractive to me, but I just never got in to them. While on holiday last December, I found Nikola. Takes a bunch of different filetypes as inputs, builds, serves and auto-reloads really quickly, and nice lazy theming from their own theme gallery, as well as swapping out themes with bootswatch. Having the site config in a native python file as well is just a nice touch of familiarity.

For now, I haven't really configured much in the theme (the default bootstrap3 theme + the lumen swatch). I haven't really configured any plugins or custom code, apart from a python script to migrate my posts and media from my Octopress source. Still, it's nice to be in python and a change is always a bit of fun.


Comments powered by Disqus