Leaf bundle or filename inherits branch bundle layout if they share some a section of their names

I have debugged all day why this is happening to no avail. Luckily, I came across this minimal example that reproduces the issue perfectly. Just follow these steps:

  1. Clone the project.
  2. In en or de folder, rename post-2.md to post-1-top-ten.md.
  3. Run hugo server.
  4. Open post titled Post 2 in browser (now named post-1-top-ten.md)
  5. Result: Post 2 inherits the post-1’s layout even though they are not related.
  6. Expectations: Post 2 should inherit the default single layout.

mmh, I read that twice and replayed … maybe I missed something

  • the linked repo does not contain en or de folder - so there’s nothing to rename

renaming posts/post-2.md to posts/post-1-top-ten.md results in

  • public/posts/post-1-top-ten/index.html
  • no public/posts/post-2 generated anymore.

I don’t get the point especially

ofc the title and content is still frfom post-2 (we just renamed a file) and all posts share same layout according to the templates

Sorry. I lost the topic. But here is the code

git clone --single-branch -b hugo-forum-topic-40858 https://github.com/jmooring/hugo-testing hugo-forum-topic-40858
cd hugo-forum-topic-40858
hugo server

I think you have encountered this:
https://github.com/gohugoio/hugo/issues/12465

Well…thanks for figuring that out. I was creating a series of items that will share a few words and then different last parts. For proper organizing, I would prefer to maintain my designated order, but for now, I will find a way to do it differently until this is solved.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.