Go Hugo!

A few years back, this website ran on WordPress. I genuinely like WordPress, not just for blogging but also for some general (simple) content needs.

What I don’t like about WordPress? The size of the server that’s needed to run a full LAMP stack (securely) so that you can run WordPress. And if you don’t have a high functionality need, that translates into wasted overhead: read cost. And even a simple WordPress installation isn’t cheap to run, the database component alone requires more oomph that people realize.

This site is almost entirely text. And search was almost ever used. So there wasn’t much reason for me to hang onto WordPress if the most valuable feature lay dormant. (Most of my incoming traffic is Google, so that’s where search is actually done.) Which led me to wonder if I could just serve out a static site again.

I say “again” because that’s how this site started: a static, HTML-based template. A bit more manual than I would have liked, but at the time that’s the bulk of what was available. Then came WordPress, which we’ve already discussed. That led me to using Markdown and Metalsmith.

Except Metalsmith wasn’t really being maintained much anymore, and I have a bit of a long-standing dislike of NodeJS (especially npm) and the amount of – wait for it – overhead needed to manage the stupid thing. That, and Metalsmith was not being updated anymore.

My friend Jeremy turned me onto Hugo. It’s framework, not unlike Metalsmith, that – with some templating and a wee bit of code – turns Markdown files into a website. And since my website was already Markdown-based, it was fairly simple to move it over to Hugo. And no Node.

The hard part has been getting the deployment to work. I host my site on Cloudflare (which does static sites like nobody else), but I wanted to move to Cloudflare’s Pages service for simplicity. The documentation, however, was a bit lacking on what I needed for the deployment to work.

That’s been my day today, trying to get this to behave. I feel like I’m almost there, so close that it’s painful. The biggest issue is that I don’t have a clue why I’m not getting into the Production state, every deployment is going to Preview, and it’s not clear why. I’m 99% certain it’s a branch issue, but I don’t know what branch is needed. I suspect this is a tomorrow thing.

But, easier site development, easier deployment, much lower overhead. That’s always a good thing.