As is customary for those who’ve converted from WordPress to Octopress, here’s a quick post about my experience converting this blog.
Getting the blog up and running was a cinch, especially with a good example to examine when I had questions.
Converting old entries
To convert my WordPress entries, I turned to exitwp. It worked pretty well, but I ran into two issues.
The first was that the YAML blob at the top of the converted posts wasn’t formatted correctly.
1 2 3 4 5 6 7 8 9 10 11 | |
I solved this by switching to chitsaou’s fork.
The second problem was that html2text, which exitwp uses to do the actual conversion, was hard wrapping lines at 78 characters. I fiddled with it for quite a while, hacking the backend code for html2text, but then I remembered that markdown parsers pass HTML straight through (and that I don’t care if old entries are regular HTML). So I just modified the exitwp script to gut the html2fmt method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Old source highlighting plugin
I had used SyntaxHighlighter Evolved in WordPress to handle my syntax highlighting needs, so I needed to convert those to Octopress’ triple backtick format.
For this, I turned to some perl one liners:
1 2 3 4 | |
That first one uses a little trick to slurp in entire files (seen here) and decode HTML entities.
Finishing touches
And, finally, many urls on my site included the hostname, making the Octopress preview less useful. One more perl one liner:
1
| |
Final verdict
Octopress is awesome.
Enjoy.