Switching to Hugo

Ever since I first created this blog I’ve had reservations about using Wordpress. It’s not that I have anything particularly against Wordpress, it’s just that as someone who is more comfortable on the command line than in a browser, I always felt a little out of my element.

It also felt a bit like overkill running a small, fairly static blog with a backend database to hold all of the content, even if that database was just a tiny MariaDB instance. It was running in a docker container, but I’d neglected it for almost two years because, honestly, who really has time to pay attention to that stuff for a tiny blog with about 0.3 viewers? Plus, even that “tiny” database image was weighing in at over 400MB (side note, newer versions are down to around 100ish MBs compressed, so I guess that’s good?).

All of this had been weighing on my psyche for quite some time. I’d been thinking about using Hugo for a while, but I knew converting everything over was going to be a huge pain in the neck. It got to the point where I had stopped writing blog posts because I didn’t want to use the clunky Wordpress interface and knew I’d just be compounding my misery when I finally did switch everything over. The problem though was at the same time didn’t want to deal with the cognitive burden to figure out how to actually do the conversion.

But that’s all behind me now, as the new site is up and running. Switching everything over required:

  • Dumping all of the posts into XML
  • Converting the XML into a series of markdown blog posts (I think I used blog2md in a container, but this got lost in a container somewhere)
  • Figuring out how to use Hugo to generate static sites and trying to work out a similar theme
  • Fixing up each of the blog posts to be formatted correctly (apparently Wordpress and Hugo markdown isn’t quite the same)
  • Figuring out how to display galleries in Hugo (I still don’t have the old photo captions ported over, but maybe one day)
  • Converting all of the old galleries
  • Upgrading the Digital Ocean droplet to run Ubuntu 18.04 (it was still on 16.04)
  • Upgrading Docker and docker-compose to 19.03 (they were on versions from 2017!)
  • Getting nginx to work properly with the new static site and the old TLS certs from Let’s Encrypt (the site now has an A+ from Qualys. Huzzah!)
  • Switching Let’s Encrypt to properly upgrade the certs (the jury is still out on if this is actually working, but the cert is still valid for another month and a half)

So all in all, not the easiest process, but it’s alive! The best part now is I can easily write blog posts in markdown with vim and test them out locally using Docker Desktop, push them to GitHub when they’re ready, and then easily refresh and rebuild the site. There’s still some things to do, like minifying everything, but the site load times are already blazingly fast with just static content and nginx.