Blog update 2022: migrated to Hugo

Thu, Jan 20, 2022 7-minute read

2022 update… with a fresh new look

OK bear with, this could take a while as I am currently writing this all in markdown. Or at least attempting to. I haven’t published in this way in at least 20 years since University days where it was popular to use LaTeX for typesetting scientific articles. For at least the last 10-15 years I’ve been using Wordpress as the CMS platform for this blog and, as we shall find out, for one reason or another I decided it was time for a change. So this may end up being a mini-series on how and why I moved my blog from Wordpress to Hugo and any experiences or observations along the way.

Why!?

This seems like the obvious place to start. There were numerous reasons but the trigger was Wordpress - and more specifically its performance. It’s pretty popular amongst techies to hate on Wordpress - for crap reasons ranging from you should be able to do better yourself all the way through to decent reasons like the endless security flaws in the plugins model. I’ve always sat somewhere approximately in the middle where I’d much rather have a more custom-crafted website but the time and effort just wasn’t warranted. I’ve hand-rolled CMS in the past but this never made much sense when switching to a ready-made solution - and I’ve been using Wordpress for a loooong time now - was just the obvious thing to do. There’s probably a whole discourse around this to be had.

So I don’t particularly buy in to the ‘Wordpress is shit’ mentality - it allegedly powered 37% of all websites on the internet in 2021 but it’s also not unfair to say that the experience has got progressively worse over the years - worse that is for people like me who prefer something simple and ‘rougher’ - no doubt as Wordpress has developed it has been forced to build in all sorts of the extra bells and whistles that your average ‘just want to publish don’t care about the tech’ person wants. My needs have always been fairly simple. I’ve used the built-in or freely available templates and the odd plugin. Nothing excessive. I am hardly a prolific blogger (which will become relevant later) and so something that just sort of works has always been enough. I’ve seen Wordpress change a lot - remember when the first cut of the auto-updater rolled in which has now grown in to a full-fat update engine - which, by all accounts, is absolutely needed given how frequently vulnerabilities are discovered, which is of little surprise when software gets to the sort of size that Wordpress now is.

In fact, in recent years, the blog became a place that I was using as an online memory bank for when I’ve fixed some obscure SharePoint issue (usually) - of which there are plenty - if I’ve had to fight to find the answer to something, then I post it somewhat because I imagine there is likely to be someone else out there looking for the answer - but moreso because I know full-well that I am going to encounter this very same issue again and so my blog serves me more than anyone. I don’t need to remember how to solve the problem; I only need to know how to find the answer again. And it’s amusing (and surprising) how often this actually happens.

But as I was actually using my own site, I became more aware of how poor the performance was. Whilst it ranks in Google for various keywords, when getting to the site it would take several seconds to load and any sort of navigation around was similarly sluggish. Searching was horrific. The comments section was always overrun with spam, even though the built-in spam detection did a pretty good job. It was constantly emailing me to say it had either been updated or needed updating. (And I was removing it from my webhost I became very aware of exactly how much bloat the whole platform has picked up over the years.) And I had never been a huge fan of the new ‘block’ style editor.

Ch-ch-changes

Having said all that, the site nevertheless ran and was functional and really wasn’t particularly high up my priority list of fires that needed extinguishing. But I have made a few resolutions for 2022 which in a roundabout sort of way affect my online (and social) presence and actually putting this site at the center of all that tended to make sense.

And with that in mind, it desperately needed a makeover. Not just the look and feel and performance issues, but there was a lot of historic content (this whole site in reality dates back to the late 1990s) which needed addressing. There was a lot of broken stuff (bad links, missing attachments, etc.) which now made very little sense. Or there was content that was not really suited to a blog format. The site was born in the days pre-Twitter / Facebook and so it had started out as that… me in my 20s (ish) posting short stuff that has no real place on the web today. In other words, I’ve been back and cancelled much of my early self. How very woke.

(If you happen to be one of my kids reading this at some point in the future, then I’m sorry - I’ve removed the majority of the really embarrassing stuff.)

Why Hugo?

So with mind made up that it was time to move, the obvious question was - move to what ? This decision was mostly led by the type of site this is and the frequency with which I update things. It is roughly 50% a landing page for me - if for some reason people do want to know more about me - and 50% a dumping ground for the odd thought or two I have on tech issues or such like. In other words, it is mostly static, updated infrequently - it is read much more often than it is written - and so it supported shifting to the static site paradigm which have become very popular in recent years. And by shifting to a ‘pre-compiled’ site (effectively) then it solved the issues of performance (no dynamic calls, just render an HTML file) and (mostly) the security vulnerabilities.

I wanted to keep most of the content - and I especially wanted to keep the URL structure as there are a few pages that still receive a lot of traffic - and some pages I am actually proud of. I’m generally not too worried about SEO things - if people find the blog then great, if not, it doesn’t make a great deal of difference to me.

(That said, I am curious to see what happens to the traffic with the new site. The things I write about tend to be quite niche so are relatively easy to do well in search engines without a great deal of effort. I was using the ‘Yoast SEO’ plugin in Wordpress which basically would just nag me to write more / tag more / keyword more etc.)

There was no real need for a database (or so I thought) and I am comfortable writing in an actual editor as opposed to an online form. I was not going to write my own system so using something widely available made sense. Various options exist for static site generation - GitHub pages, Jekyll and a gazillion more, but a colleague had mentioned Hugo a while back - which works nicely on macOS, and is easy to install using Homebrew - so to be honest that was about as extensive as my research was. I’ll admit to some nervousness that Hugo (or any 3rd party platform) balloons in to a monster like Wordpress did, but that’s always a risk. And at least the sensible directory structure and use of markdown for authoring does make it fairly easy to transfer in the future should the need arise. Hopefully.

So let’s (Hu-)go

And that’s probably all there is to say on the matter. As I’m writing this the new site is uploading and all being well this stage will be complete. Next up - what was involved.

Posts in this Series