Is there a way to create permalinks in Hugo (the static site generator written in Go) that are similar to how StackOverflow/StackExchange creates for questions?

For example, consider this question's URL:


The number 827823 is a unique identifier for the question. The /in-hugo-how-... part is optional and ignored by the web server, however it is included for better SEO.

(Ignored? Yes, try removing it, or altering it. The SO web server ignores that part as long as the number is a valid question number.)

My first attempt is to set the id as the "slug" and then use a permalink format like "/:year/:month/:slug/#:title" but the URLs that are generated omit the # and anything that follows.


1 Answer 1


I think it is not possible, as the slug is the identifier. The site structure simply reflects the structure of your content directory.

Not the answer you're looking for? Browse other questions tagged .