Migrating to Pelican

Sat 23 July 2016

I've been considering for a while to port this site to a static site generator like Jekyll from the bottle based mini blogging/CMS engine I created a few years back to learn web development. I finally decided to make the plunge this weekend, although I decided to go with Pelican instead of Jekyll. The migration process has been much quicker and easier than expected. Half of my blog posts have been shifted over and I've re-created most of the other site content and design too. So all the major hurdles are out of the way.

Static site generators

So why move from a working solution to something new? The main reason was poor python support from my web hosting provider. I had no choice but to use CGI to get things to work (yay 1999)! This always irked me and made me feel dirty. I definitely should have done better research into the "python support" they claimed to provide.

Static site generators provide an elegant solution to this kind of problem (and have whole host of other benefits too). They effectively allow you to generate HTML pages via templates. No need to worry about databases, security holes or language support. It's just HTML/CSS/Javascript being served up by your web server (many have been using Github pages)! Further, the workflow is completely command line driven and you can write your blog posts in markdown in vim too! Understandably because of this, all the cool geek kids (and even some big companies) are doing it!

Pelican

Initially, I was considering Jekyll as that appears to be the most popular static site generator. But being a python guy I thought that there must be a decent python equivelant (Jekyll is ruby based). I set off Googling and discovered that Pelican was the most actively developed and used in the python world. It uses the jinja2 templating engine which I have experience with and generally looked sensible and simple to use. So I opted for that.

Migration

It took me a few hours of reading to understand the basics of Pelican and I was able to start moving things over. Most of the hard work was actually adapting one of the pelican themes (notmyidea-cms) to resemble my old site design and making it mobile friendly. Bit of a hacky process but it's mostly done.

Since I wasn't a very prolific blogger I'm just copy pasting my blog posts over.

Conclusion

So far I'm quite happy about making the move and I would definitely recommend bloggers who're technically inclined to explore static site generators and Pelican in particular. If you're using something like wordpress I believe there are scripts to make the migration process simpler. The documentation is good and there are plenty of tutorials on the web to help you out too.