#blog

Fixing My Own Blog, Five Years Later

A follow-up to my first two posts, and what I got wrong after them.

In March 2021 I wrote two posts about setting up this blog with Hugo and GitHub Pages. I said I was "all set". And for a few months, I was.

Then I stopped looking at it. Five years later I came back, and the site I thought I had wasn't the site anyone could see.

What actually happened

Digging through the git history, the story turned out to be two commits on one evening in June 2021, named test and try. I can tell from the names that I didn't know what I was doing.

  1. test moved the whole project into a subfolder. That quietly removed the link to the Hugo theme, which was a git submodule.
  2. try moved everything back out. But the deploy workflow landed in workflows/ instead of .github/workflows/, and the theme link never came back.

GitHub only runs workflows from .github/workflows/, so from that evening on, nothing deployed. The live site stayed frozen at the build from March 2021, served from a separate gh-pages branch. Nothing looked broken, because nothing was changing.

Then the domain expired

The old site used a custom domain, blog.ftchen.site. At some point I let it lapse. GitHub Pages still had the domain saved, so visiting ftchen93.github.io redirected to an address that no longer existed. Every link inside the old site was built with that domain baked in, too.

Two more small mistakes were hiding in there: the CNAME file contained https://blog.ftchen.site (it should hold only the domain name), and it sat in a folder where it did nothing.

How I fixed it

  1. Dropped Hugo. I rebuilt the site as plain HTML and CSS. There's no build step and no theme to keep in sync, so GitHub Pages serves the files exactly as they are in the repo. For a personal site with a handful of posts, that's a much better trade.
  2. Removed the expired domain under Settings → Pages → Custom domain.
  3. Pointed Pages at the right branch. In the same settings, I switched the source from gh-pages (the frozen 2021 build) to master, folder / (root).

The site is back at ftchen93.github.io, and this post is the proof that publishing works again.

Lessons

  1. Check the live URL, not localhost. A site can look fine for years while serving an old build.
  2. Name commits after what they do. "test" and "try" told future me nothing.
  3. Fewer moving parts break less. No build step means nothing to silently stop running.
  4. Put domain renewals in your calendar, or don't use a custom domain at all.