Skip to content

Hugo with uglyURLs = true generates /public/section.html instead of /public/section/index.html #4428

@ChrisTucker2000

Description

@ChrisTucker2000

Discourse thread: https://discourse.gohugo.io/t/section-index-md-page-isnt-being-created/10627
Sample project: https://github.com/ChrisTucker2000/hugorepro

Steps to reproduce:

  1. Create a section index page, e.g. /content/cats/_index.md.
  2. Create an appropriate template file, e.g. /themes/mytheme/layouts/_default/list.html.
  3. Set uglyURLs = true in /config.toml.
  4. Build the website with hugo.

Expected result:

  • The page should be created as /public/cats/index.html.

Actual result:

  • The page is created as /public/cats.html.

Additional information:

There is a Hugo documentation page discussing how uglyURLs works: https://gohugo.io/content-management/urls/#ugly-urls
It clearly says on this page that /content/about/_index.md will map to https://example.com/about/ with uglyURLs = false and https://example.com/about/index.html with uglyURLs = true (so basically the same output file).
This is the behavior that I expect, but it is not the behavior I'm getting.

Therefore this is either a bug in Hugo itself, or a mistake in the documentation. I hope it's the former, because this behavior seems totally bizarre and insane to me.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions