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

resources.GetMatch, resources.Match, and resources.ByType anchorize and lowercase resource permalinks #12182

Closed
jmooring opened this issue Feb 29, 2024 · 2 comments

Comments

@jmooring
Copy link
Member

jmooring commented Feb 29, 2024

Maybe this isn't so important with images, but it is very important with things like:

assets/
├── 401K Prospectus.pdf
├── Employment Agreement.pdf
└── Non-disclosure Agreement.pdf

resources.Get (PASS)

{{ with resources.Get "401K Prospectus.pdf" }}
  {{ .RelPermalink }}                                 --> 401K Prospectus.pdf
{{ end }}

resources.GetMatch (FAIL)

{{ with resources.GetMatch "401K Prospectus.pdf" }}
  {{ .RelPermalink }}                                 --> 401k-prospectus.pdf
{{ end }}

resources.Match (FAIL)

{{ with resources.Match "401K Prospectus.pdf" }}
  {{ .RelPermalink }}                                 --> 401k-prospectus.pdf
{{ end }}

resources.ByType (FAIL)

{{ range resources.ByType "application" }}
  {{ .RelPermalink }}                                 --> 401k-prospectus.pdf, etc.
{{ end }}

This does not happen with v0.122.0, nor does it affect the corresponding methods on Page.

Reference: https://discourse.gohugo.io/t/hugo-v0-123-image-resources-being-converted-to-lowercase/48581/2

@bep bep removed the NeedsTriage label Mar 1, 2024
@bep bep self-assigned this Mar 1, 2024
@bep bep added this to the v0.123.7 milestone Mar 1, 2024
bep added a commit to bep/hugo that referenced this issue Mar 1, 2024
bep added a commit to bep/hugo that referenced this issue Mar 1, 2024
@bep bep closed this as completed in 7023cf0 Mar 1, 2024
@AlanBreck
Copy link

Thank you!

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 Mar 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

3 participants