Skip to content
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

Page.Resources.Get is broken in 0.123.0-DEV #11944

Closed
TiGR opened this issue Jan 30, 2024 · 2 comments
Closed

Page.Resources.Get is broken in 0.123.0-DEV #11944

TiGR opened this issue Jan 30, 2024 · 2 comments
Assignees
Milestone

Comments

@TiGR
Copy link

TiGR commented Jan 30, 2024

The problem is: hugo now somehow converts resources names - it brings all to lowercase and replaces spaces with dashes, and .Resources.Get no longer work.

For example, we have a page resource named Test 1.jpg. Formerly .Resources.Get "Test 1.jpg" worked, but not with development version (we've tried it since we really need the optimizations that are coming next version). Also, dumping .Resources shows that internally hugo represents that resource name as test-1.jpg.

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

$ hugo version
hugo v0.123.0-DEV+extended linux/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

No, it works fine in 0.122, but it is broken in dev version (commit ec22bb3).

@bep bep removed the NeedsTriage label Jan 30, 2024
@bep bep self-assigned this Jan 30, 2024
@bep bep added this to the v0.124.0 milestone Jan 30, 2024
@bep bep added the NotSure label Jan 30, 2024
@bep
Copy link
Member

bep commented Jan 30, 2024

Also, dumping .Resources shows that internally hugo represents that resource name as test-1.jpg.

The problem in your case is, I guess, the spaces in the file name, something I would strongly advice against (In Hugo, but I guess also in general).

I will check this case, though, I see we check both the normalised and the original name, so the above should work.

@bep bep removed the NotSure label Jan 30, 2024
@bep bep modified the milestones: v0.124.0, v0.123.0 Jan 30, 2024
bep added a commit to bep/hugo that referenced this issue Jan 30, 2024
bep added a commit to bep/hugo that referenced this issue Jan 30, 2024
bep added a commit to bep/hugo that referenced this issue Jan 30, 2024
@bep bep closed this as completed in 80595bb Jan 30, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants