Fixing the Site Permalinks

Published on

Today I realized that I had incorrectly set up a permalinks definition for the posts section of the website in a way that left the posts/ folder out of the generated path name. That wasn't how I intended the site to be laid out on-disk.

Since my content organization was the way I wanted things to end up, the permalinks definition was redundant as well as incorrect. However, I realized that I couldn't just remove it, as any-and-all links that I had previously shared on Mastodon would be broken!

Thankfully, Hugo has a solution – the aliases definition in the front-matter. Using this, I was able to keep around the incorrect links as well as get everything placed properly in the correct location going forward.

I'm just glad I caught it now, before I had more than a handful of posts to have to fix.

A big shout-out to this article by Joshua Sheppard which had the solution to my quandry.