Love to code although it bugs me.

16 Mar 2021

Hugo post tag causing 404 Error

I write code mainly in C# so imagine my surprise when I was testing the tags on this site and that one in particular caused a 404 - Not Found error.

After some searching, I found the source file where the Hugo theme I’m using renders the tag links (\hugo-vitae\layouts_default\terms.html).

The only character causing this error, so far, is the “#” so I edited the file for a quick and dirty solution, replacing the special character ‘#’ with the URL encoding ‘#23’. Rebuild and deploy the site and it’s working fine.