
Give Hugo a Slug...!!!
Special Characters in a Hugo Title
That was a sneaky one! I put three dots or an elipsis (…) in the title of my blog post. I am using Hugo to display my blog posts.
When I deployed the post it was not obvious but the URL was not correct and I was receiving Access Denied errors… WTF?
This is a good lesson worth noting here: Hugo slugs (the name of urls and directories it uses to create your posts) come from titles by default, and special characters can cause weird problems.
how to work around or totally avoid
Adding an explicit slug field in the post information section gives you full control and prevents surprises.
Good Practice Going Forward:
For any post with special characters in the title (punctuation, emojis, quotes, etc.), add an explicit slug:
title: "My Post Title: With Colons & Special Chars!?"
slug: "my-post-title-with-colons-and-special-chars"
Keeps URLs clean and predictable!
Have questions or want to share your own sysadmin story? Leave a comment below!
(I will set up comments eventually ;)