gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.78k stars 7.53k forks source link

Distorted lookup sequence when using .Render #7956

Closed richtera closed 3 years ago

richtera commented 3 years ago

Hugo Static Site Generator v0.78.1/extended linux/amd64 BuildDate: unknown

Reproduced in the last version.

I have created a repo to show the problem. I made mods to the theme so I moved it directly into the repo Hugo Static Site Generator v0.78.1/extended linux/amd64 BuildDate: unknown

I created three versions of "summary-with-image.html" to be called from .Render. So some reason it works in some cases and not others. In my actual production scenario it additionally seems to depend on the depth of my page bundles. It's very confusing. Not sure what to start looking at.

When you run this it should show a page image

But it in fact shows image

This seems to indicate that the "post" type inherited from the folder name (i.e. section) is different than setting "type": "post" in the frontmatter. Very strange.

richtera commented 3 years ago

Although there is something going on I can't quite figure out, this particular sample doesn't do the right thing due to "post" vs "posts". The layout folder should have the same name as the content subfolder.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.