I’ve been considering moving away from blogger and using one of the static site generators for my blogging needs. There’s quite a few things in the way though - migrating content, search engine rankings and then the fidelity of the migration. The last time wasn’t too easy so I’ve been putting it off for sometime… finally, I’ve gotten around to it and it took some doing.
My blog was initially on Wordpress.com and then I moved to Blogger about 6 or 7 years ago. While I moved content from one to another, there was quite a lot of cruft that had built up - duplicate posts, badly tagged content and so on.
After looking at available SSG’s, I decided to go with Hugo. Hugo’s in Go and it’s a single binary - so it’s pretty
easy to stick anywhere on the machine and work with it. It’s also quite fast - though since I use AsciiDoc, I still
asciidoctor around which slows down Hugo a bit.
The nice thing is that there’s nothing stopping me from blogging with both AsciiDoc and markdown at the same time.
My existing blog on Blogger is sort of automated - I use my very own EasyBlogger to give me a CLI interface and then use vim to author posts in AsciiDoc or Markdown. This has served me well for the past few years - but making style changes on blogger is quite a pain. EasyBlogger also supports pulling down posts from blogger and then running it through pandoc and writing each post to a file. In any case, I needed to export all my posts out of blogger and ensure that old urls work so that I won’t be penalized by search engines. Given Hugo’s (and other SSGs) well defined front matter, it was a simple task to enhance EasyBlogger to generate files for each post with Hugo’s TOML frontmatter information.
There’s quite a few themes available for Hugo - but finding one that I liked unequivocally was harder. In the end I went
hugo-bootstrap-premium but ended up making a number of changes and tweaks. Thankfully, Hugo’s theme customization
is quite ok - but I do feel that at the moment, I’ve made a far more number of changes than I’d be happy with.
Besides this, I also wanted to use AsciiDoctor’s default theme file -
asciidoctor.css - making sure that the hugo theme
css and AsciiDoctor theme don’t step on each other isn’t quite fun for someone who’s as bad at CSS as me.
Looking at hosting options, Github pages popped up first but I decided to go wtih Gitlab’s pages since with the integrated pipelines, I can set up push deployment way more easily than with Github.
Finally the biggest task was cleaning up posts, deleting duplicates, getting rid of old/outdated (wp.com) sourcecode macros and cleaning up tags and so on. The content clean up probably took the most time and there’s not much I could have done to short circuit that. Another time sink was all the theme and template changes - for ex. to get a year wise archive page of posts it took a really long time since this is my first encounter with go templating and Hugo’s template rendering rules. I didn’t mind this as much since a) it’s probably a one time effort and b) it wasn’t all that boring.
|Moral of the story - if you’re going to migrate a blog with content for 10+ years, set aside a few days!|