Slug not overriding folder name in bundle

Hello everybody!

A while ago I posted an issue on GitHub that I think is an obvious bug, but since @davidsneighbour said “this is most probably not a bug in Hugo” and asked me to post here, I’ll go ahead.

My issue is that when I create a bundle, the slug is derived from the folder name and not from the slug parameter in the frontmatter that I explicitly set.

Here’s a minimal working example.

Any help is appreciated. Thanks!

PS: I’m a first time poster, hope I’m doing everything right. I’m on the latest version of Hugo, version 0.72.

Thank you for creating a public repository. It makes your question much easier to understand.

A slug defined in front matter is applicable to single pages (example: or, not list pages (example:

You can override the url of a list page by specifying a url in front matter, but it will not cascade down to child pages.

I know of only two ways to override the section portion of the URL:

  1. Rename the directory.
  2. Specify a permalink pattern in config.toml.
1 Like

Thank you!

So my issue would be more of a feature request, I guess.

It seems very counter-intuitive to me that slug is only applicable to single pages and that it doesn’t cascade down. On WordPress, that is standard behavior.

I understand. Personally, I find it easier to have URL patterns centralized in config.toml instead of having to edit the front matter in multiple list pages. Glad I was able to help…

1 Like