Back to Front Page

07.08.2012 Goodbye Wordpress

I have talked about Jekyll before briefly. I totally restarted with this blog and that was a piece of cake. The content was the only thing I wanted to save and I got out fresh without digging deeper into Jekyll and Liquid. The next iteration was far more interesting and frustrating. I decided that I will replicate the other blog as closely as I can. The journey is almost complete. The only thing missing is the RSS feeds. Those are the only two dead links on the site.

I want to record some of the hacks I had to create. This is still work in progress and I will try to update any progress in this post.

Exporting

The first step of getting a blog liberated from WordPress is getting an XML export. That is explained well in the Jekyll Github page that I am not going to repeat it here.

The Erudite

The theme on the site is The Erudite by Somadesign. It is a pretty complex theme with a separate style for the home page. There are some elements on the page that slide open using JavaScript and that is a nice effect for a static page. The first step of realizing the dream was to pull all differently themed pages from the WordPress site. The language on the site is Finnish so the text on the pages is pretty useless for an anglophone.

The next stage was finding the common parts of all pages. Any good diff tool is a friend when doing that. Whenever I found an element that only exists in one layout, I replaced it with a {% comment %} tag and move on. On the next sweep I started looking at what those entities would be called in Jekyll lingo. Most of it was trivial. The documentation is not good but there are things like post.next.title and the unless statement that solve many problems.

Categories

The other blog was using a hierarchy of categories. I have created the categories in this blog by using the page.category to loop through site.categories and that would give me all necessary posts to show on the page. That was not enough. I created another hack that loops through page.categories. I just noticed that even if it does get all the pages, it lists them category by category and allows duplicates. Not cool. Basically I would have to iterate over all posts. You live, you learn.

Archives

The theme exposes archives by author and month. My implementations are a bit crude but get the thing done again. Especially the parameters should rather be in the YAML instead of the page body.

Table of Contents

In case you want to have a table of contents on your pages, like this one has, you should make your template in a way that there will be an H1 element within the Markdown. When that is handled add a list with one item on the page like this:

* This will be replaced by the ToC
{:toc}