Moving Your Blog To Jekyll: The Translation
tl;dr: If you’re planning to move or export a blog to Jekyll, first look at Jekyll Importer. Hopefully, you’ll save a fair bit of time. If you’re moving from Typepad, it’s a bit complicated.
Moving from Typepad is relatively straightforward, but not yet a smooth path. Step 1 is universal: export your blog to MTIF format. From there, you’ll find a number of ways to do the translation.
I first found https://github.com/dams/typepad_to_jekyll, a perl script which does a good chunk of the work. I found a couple of burning issues with this one:
- It used 1 or 0 for the Jekyll Front Matter published tag. Jekyll requires this to be true or false. Since 0 is truthy in Ruby, this means all your drafts would be instantly published. Turns out I had an embarrassingly high number of drafts.
- It didn’t quote post titles. If your post titles contain quotes or colons, this could cause Jekyll to fail to generate these properly.
I forked and fixed those, but there were other things I wanted to get working like carrying the permalink and the date into each post. In the end, I decided to move on. This is when I discovered jekyll-import, which handles a Movable Type instance by attaching to the database but doesn’t handle a Movable Type export file.
Okay, so all I need is a parser for the export file and writing the importer for Jekyll will be a snap. Ideally, there’d be a gem I can import, but life is rarely ideal. Instead, I found two other projects who’ve written parsers in Ruby:
- Typepad to Jekyll (blog post). Chris found the same perl script and wrote this instead. It does a fair job, but the code isn’t segmented in a way I could use directly in a jekyll-importer.
- Marc Chung’s ruby-mtexport. This has a well-segmented parser, but isn’t a gem. I’ve written Marc a note to see if he’ll gemify it; if not, I’ll write up an MTIF parser gem and make the importer.
So hopefully this is a good jumping-off point if you were looking to move from Typepad to Jekyll. I’ll either update this post or add another when/if I get back to the jekyll-importer project.
blog comments powered by Disqus