in about english code ~ read.

Ghostbusters

I haven't blogged for quite a while now. This was due two reasons, first I didn't have that much time (read motivation) and second my old Octopress setup was horribly broken. But this weekend I choose to change this. I looked a round on the web which the new shiny blogging stuff is and stumbled up on ghost. Actually not. I know ghost for quite some time and I am running another blog which is focused on my hobby, kayaking.

What I did was, looking around on the web if there is an easy way to import my posts. Since most of the old posts are written in markdown it shouldn't be that much of a problem. And I found a small python script that could import Jekyll/Octopress posts into ghost. I ran the script and it needed some small modifications because the JSON layout changed slightly. I had to change lines from 140 on to:

ghost_data['db'][0]['data']['posts'] = posts  
ghost_data['db'][0]['data']['tags'] = tags  
ghost_data['db'][0]['data']['posts_tags'] = posts_tags  

After successfully importing the JSON I noticed it was missing about half of my old blogposts. I checked the markdown source and realized that I had imported the old Wordpress posts into Octopress as plain HTML. So I used some JavaScript to convert the html to markdown. (God damn I hate this node.js stuff). But it worked quite well.

And here war are with a new shiny blog that includes all the old content and even the old links should still work cause I did some nginx rewrite magic.