Moving to Octopress
Behold! Fuzzy Tolerance has moved from Wordpress to Jekyll/Octopress.
I have been pondering moving this blog to Jekyll ever since I read this post from Development Seed. Right now it is using the default Octopress template, which is really nice and fully responsive, but it will soon be replaced with a (uglier) version of my own creation. There will probably be some bugs I need to smooth out here and there as well.
I really like Octopress so far. Writing posts in Sublime Text 2 in Markdown is kind of awesome, and being straight HTML it’s crazy quick. I thought I’d do a quick Wordpress to Octopress post to capture a few tricks before I forget them entirely.
Converting Wordpress Posts
There are a number of ways to get from Wordpress to Jekyll. I found a lot of posts that recommended Exitwp, but I found that method ate iframes to video content. I ended up going with Jekyll’s built-in Wordpress export file converter:
ruby -rubygems -e 'require "jekyll/migrators/wordpressdotcom"; Jekyll::WordpressDotCom.process("wordpress.xml")'
If you have to fix a bunch of links, let me introduce you to my friend
sed is one of those freaky commands that doesn’t appear to run in normal space-time. I had it process 500+ text files, and I swear it was done before I pressed the enter key.
sed -i 's/oldurl.com/newurl.com/g' *.md
Set comments: true
The conversion process left all of my posts with comments off (or more specifically no comment yaml). Say hi to
sed again. This sticks comments: true on the second line of every markdown file.
sed -i '2icomments: true' *.md
As it turns on, zsh doesn’t like some rake commands. To fix that, drop this in ~/.zshrc:
alias rake="noglob rake"
This was the only real pain in the ass. Wordpress adds a funky [caption blah blah] thing to captioned images, and I couldn’t figure out a great way to filter those out and convert them. This is the only thing I had to edit by hand.