Slug for leaf/index pages

Dear community,

slug does not seam to work for leaf pages. This is my setup:

├── contact
│   ├──
│   ├──
│   ├── contains this front matter:

slug = "kontakt"

Yet, this page is rendered: /de/contact/kontakt/index.html (wanted: /de/kontakt/index.html).

page = "/:slug/"

does not change the URL.


  • I would like to avoid translationKey. This can get tricky.
  • It would be great to have all related content in one folder—including page resources. Therefore I am trying to avoid e. g. and in the root folder.


I have:


… and:

    post = "/:section/:slug"
    page = "/:slug"

With the latest hugo, it’s working for me. Did you try:

 contact = "/:slug/"
1 Like

Thank you!

That’s a very clever hack.

It also allows (simulating) deep nesting/subfolders of leaf pages—a feature I always missed(*). The only disadvantage maybe is that you need to slugify all leaf pages.

Yes, I had tried contact = "/:slug/", but it did not work—and the site is far too big for this.

(*) My hack for deep nesting was using files in subfolders with front matter layout = "single". Your hack is a lot more out of the box!