Pelican Powered

Tue 02 July 2013 by Jim Purbrick

Almost exactly 5 years ago I set up The Creation Engine No. 2 as a Byteflow blog running on Django when the original Creation Engine blog hosted by Linden Lab stopped being a suitable place for my thoughts on technology as a platform for creativity.

Byteflow and Django served me well until late last year when Recaptcha finally crumbled and I found myself spending an increasingly tedious amount of time cleaning up spam comments.

I considered just replacing the comment system with Disqus and Akismet, a particularly slick combination which I used on Creatarr, but without comments Byteflow’s full Django openid account system started looking pretty archiaic and heavyweight, especially when compared to the Octopress on github blogs that all the cool kids are using.

After some playing around with various modern static frameworks I settled on Pelican, a python framework with some nice, responsive themes built with Django based Jinja 2 templates which would be easy for me to hack around.

In a couple of hours I had a new git repository containing my blog posts imported in to a content directory, a fork of the pelican themes in a theme directory, my jimpurbrick.github.com repository in an output directory and all of the pelican dependencies listed in a requirements.txt ready to be pip installed in to a python virtual environment.

Moving jimpurbrick.com to gh-pages simply required adding a CNAME file to the jimpurbrick.github.com repository and pointing DNS to github and it was possible to emulate Bytemark’s clean URLs with Pelican by combining the post date and slug in it’s URL and storing each post in an index.html file so that requests to the clean URL at github return the index.html file.

The same hack works to support the existing clean feed URLs which are valid Atom and RSS feeds, which could be consumed by the late Google Reader despite the “.html” extension causing github to return the feeds with an HTML content type.

ARTICLE_URL = "{date:%Y}/{date:%m}/{date:%d}/{slug}/"
ARTICLE_SAVE_AS = "{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html"
FEED_ATOM = "feeds/atom/blog/index.html"
FEED_RSS = "feeds/rss/blog/index.html"

A few theme tweaks later and I have a lightweight responsive, lightweight blog that allows me to author posts offline, supports all of the existing jimpurbrick.com permalinks and is hopefully ready for the next 5 years of The Creation Engine in the mobile first, post Google Reader era.


Comments

Fork me on GitHub