8000 templates.Exists fails for mixed-case partial filenames · Issue #13684 · gohugoio/hugo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

templates.Exists fails for mixed-case partial filenames #13684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
deltaclock opened this issue May 4, 2025 · 0 comments · Fixed by #13686
Closed

templates.Exists fails for mixed-case partial filenames #13684

deltaclock opened this issue May 4, 2025 · 0 comments · Fixed by #13686
Assignees
Labels
Milestone

Comments

@deltaclock
Copy link

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

$ hugo version
hugo v0.147.0+extended+withdeploy linux/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes

Details

templates.Exists returns false for partials with uppercase letters in their filename.
From my analysis, the bug originates from:

https://github.com/gohugoio/hugo/blob/b39b24962350090122b5f3927456dde710cffb57/common/paths/pathparser.go#L49C1-L58

It seems that when the template store is created, the filepaths added are normalized, while the argument could be a path containing uppercase letters.
I'm not sure (haven't found any docs) stating the expected format of the partial's filenames, but this issue started appearing from version 0.146.0.

See also a popular theme using mixed-case partial filenames: nunocoracao/blowfish#2102 (comment)

Screenshots

Building the template store: notice the normalized path in s and the original one in unnormalized

Image

Insertion into templatesByPath map of normalized path

Image

templates.Exists failure due to comparison of normalized and unnormalized paths

Image

@bep bep removed the NeedsTriage label May 5, 2025
@bep bep self-assigned this May 5, 2025
@bep bep added this to the v0.148.0 milestone May 5, 2025
bep added a commit to bep/hugo that referenced this issue May 5, 2025
@bep bep closed this as completed in #13686 May 5, 2025
@bep bep closed this as completed in 80f0595 May 5, 2025
jmooring pushed a commit to jmooring/hugo that referenced this issue May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0