What is the simplest way to use folders to group content files without changing the url or section tree ? Like a leaf bundle, but simpler, hugo would just flatten the directory. I won’t use leaf bundle because I need my files to bear their name, “index” is a no-go.
What I mean:
.
├── archives
│ ├── au-delà-de-l-œdipe.css
│ ├── au-delà-de-l-œdipe.en.html
│ └── au-delà-de-l-œdipe.html
├── auteur.en.md
├── auteur.md
├── essai
│ └── a.md
├── _index.en.md
└── _index.md
it should read three as if the content was of “essai” was raised one level.
irkode
September 23, 2026, 6:44am
2
If I got it right you can configure a combination of cascade and permalinks in your hugo.toml to achieve that:
do not render the section page for /essai/
render all pages below /essai/ to the Root
/essai/a.md is rendered to /a/index.html and linked as /a/ (unless you have uglyUrls set to true )
# suppress render of the grouping folder"
[[cascade]]
[cascade.build]
render = "never"
[cascade.target]
path = "{/essai}"
# redirect the urls for grouping folder content
[[permalinks]]
pattern = '/:slugorcontentbasename'
[permalinks.target]
path = '{/essai/**}'
you can tweak the filename, targets, … see:
hint: use --printPathWarnings to check for duplicates
Thought of that… but I was looking for a simpler way.