Skip to content

server: index.md inside a leaf bundle gets reclassified from resource to bundle on change #13961

@weddige

Description

@weddige

Assume the following folder structure:

/content/_index.md
/content/a/index.md
/content/a/b/index.md

When building this, the expected output would be:

/index.html
/a/index.html

/content/a/b/index.md is not a valid content file, as /content/a/index.md already represents a leaf. This is also the behaviour, that can be observed when building the site with hugo (or hugo server).

However, if the development server (hugo server) is running and a change to /content/a/b/index.md is made, this will trigger a partial rebuild, that will create /a/b/index.html. This is due to hugo determining the path type based on the file name rather than the full path of the file.

Rendering /content/a/b/index.md can lead to variety of consequences (e.g. ending up anywhere in the output, if url is set) and cause a lot of confusion.

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.147.9+extended+withdeploy linux/amd64 BuildDate=unknown VendorInfo=nixpkgs

Does this issue reproduce with the latest release?

I tested it only with the version above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions