Taco Steemers

A personal blog.

Switched from Wordpress to Pelican

Over the past two years I've posted some writing on a different domain. That is a shared Wordpress site which hasn't been seeing much love (the other party hasn't made any posts). I've been thinking of also writing some smaller notes, things that I tend to forget and then have to find out again. I'd rather not post them on this shared site because of the constant need for Wordpress updates, and because I tend to find Wordpress to be too much of a hassle when you want to make small adjustments. Therefore I decided to use a different domain and add a static site there (that is, here, where you are right now).

This site uses Pelican to create a static site from files written in Markdown . I've used Thomas Frössman's exitwp tool to get my posts from TophatCoders, the Wordpress site, in to text files with the Markdown markup. This worked quite well. Exitwp, however, is targeted at Jekyll rather than Pelican. To make sure Pelican could read the files, I wrote a small script (Python 2) to remove two lines and remove the time from the date, as Pelican didn't support the time notation that was written to the files. Of course, I only found out afterwards that there is a file in the Pelican project that seems to do the same ( pelican/tools/pelican_import.py . Because I haven't used it, I don't know how well it works, but such functionality also appears to be mentioned in the manual so it should be supported. Once again it is shown that reading the manual can be a good idea ;).

I must say I'm very pleased with how easy the entire process has been. I'm not very up to date on Pelican yet, and I haven't gotten around to adding comment functionality yet, but I am liking things so far.

There was only one problem with my workflow, accented characters:

WARNING: Could not process Notes/2014-01-03-switched-from-wordpress-to-pelican.markdown 'utf8' codec can't decode byte 0xf6 in position 967: invalid start byte

To my surprise, it choked on Thomas Frössman's name. I was typing the post on a Windows laptop and had saved that post to disk on a Debian server using nano , after pasting the characters in to nano over a PuTTY SSH connection. PuTTY didn't use the UTF8 encoding that was expected by Pelican. The fix was simple, set the Window->Translation->Character set translation->Remote character set setting to UTF8.

Now I have everything the way I want it. I have a low-maintenance site and I can add posts with all my devices.