Moving the blog to pelican

— 2014-05-07 —

A couple of days ago I swapped the static site generator used at this blog from Jekyll to Pelican. It was not to much work, mostly changing the metadata of the posts. The reason I changed engine is mostly to try out something different. I wanted to know the differences about the two of the top static site generators. It should not be surprising that I turned towards something written in python.

I configured Pelican to some level to make it behave as I wanted to. I wrote some custom path settings to remove the .html at the end of the url to each post by generating folders with index.html. The paths from jekyll where on the form /year/month/day/slug/. I still wanted to support incoming links to those parts. The urls on the new setup is in the same pattern to solve that. In time I would like to use the pattern /year/slug/ or even just the slug. To do that I need to find a way to redirect the old urls. Any ideas on how to solve the redirect issue are more than welcome. The theme will probably be available at my Github profile or something similar soon.

I created a new Pelican theme for the blog. It is a work in progress. However, I think it is a great improvement over the old blog. Especially the fact that it does not load a huge css library to display something as simple as the design of this blog.

So what about hosting?

I still host the site at github pages, using a CNAME file to serve it on my domain rolflekang.com. I use a python package called ghp-import to push the generated site to Github Pages. The source of the blog is not stored in the same repository, because I do not want people to see my unfinished posts, but still track them in the repo. Therefor I have added the public repository as a remote called gh-pages. I use the Make task below to publish to github pages. The publish task that it depends on is just the standard task from the Makefile generated by pelican-quickstart.

github: publish
  cp CNAME $(OUTPUTDIR)
  ghp-import $(OUTPUTDIR)
  git push gh gh-pages -f
    this
    static-site
    pelican
    jekyll