Reviving hakyll-convert
Summary: hakyll-convert
is a CLI tool that splits Blogger and WordPress
backups into separate posts that Hakyll can understand. I just updated it to
work with modern dependencies.
I put this blog together with a static generator called Hakyll. Before that, I was using Google Blogger and wrote no fewer than 100 posts over there. Naturally, I wanted to migrate all that content to the new place, but how?
That’s where hakyll-convert
saved me. I exported my posts from Blogger, ran
hakyll-convert
on the resulting XML file — and voilà, I had a hundred files
with Hakyll-style “front matter” and my posts’ HTML. Just copy that into my
“posts” directory, and I was done.
At the time, hakyll-convert
couldn’t rename the files according to
a user-provided template, so I submitted a pull request to add that
feature. It turned out that the program’s author, Eric Kow, no longer had time
to maintain it, so he asked me to take over. After a bit of
thought, I agreed.
hakyll-convert
is a small project, easy to keep up-to-date, and I didn’t plan
to make any grand changes. I just wanted to be around when someone submits
a pull request or files an issue. Just keep the project alive and kicking.
Fast-forward a year. I received a heads-up about an upcoming change in the
feed
package. That promised some severe breakage for hakyll-convert
, which
heavily relied on feed
’s data types. Unfortunately, I was busy with a new job,
so I didn’t have time to investigate and fix.
Another year passed. The new version of feed
came out, breaking
hakyll-convert
as expected — and I was still busy with something (don’t even
remember what exactly). So much for “being around” and
“keeping the project alive and kicking”.
Two and a half years later, I finally got around to fixing it. That turned out
to be easier than I thought: the thrust of the change was a migration from xml
package to xml-types
, which boiled down to search-and-replace thanks to
Haskell’s type system. I did introduce one logical error, but the tests caught
that.
Oh, and Blogger changed their format slightly in those intervening years, but that wasn’t hard to fix either.
And that’s it. hakyll-convert
is back now. You can install it from Hackage:
$ cabal install hakyll-convert
I also submitted a PR to add it to Stackage Nightly, and so it will make it into Stackage LTS 17 as well. Try it out, and please open an issue if something doesn’t work!
Your thoughts are welcome by email
(here’s why my blog doesn’t have a comments form)