Hugo v0.123 - Image resources being converted to lowercase

After upgrading to v0.123.x from v0.119.0, image filenames are being converted to lowercase when using resources.{Function}.

Was this intentional?

Reproduction:

git clone --single-branch -b lowercase-image-resources https://github.com/alanbreck/hugo-testing lowercase-image-resources
cd lowercase-image-resources
rm -rf public && hugo

I don’t think so.

assets/
β”œβ”€β”€ A.jpg
└── B.jpg
{{ with resources.Get "A.jpg" }}
  {{ .RelPermalink }}                 -->  /A.jpg (GOOD)
{{ end }}

{{ with resources.GetMatch "B.jpg" }}
  {{ .RelPermalink }}                 --> /b.jpg  (NOT SO GOOD)
{{ end }}

{{ range resources.Match "*.jpg" }}
  {{ .RelPermalink }}                 --> /a.jpg /b.jpg  (NOT SO GOOD)
{{ end }} 

{{ range resources.ByType "image" }}
  {{ .RelPermalink }}                 --> /a.jpg /b.jpg  (NOT SO GOOD)
{{ end }}

Maybe this isn’t a big deal with images, but it certainly isn’t desirable with:

assets/
└── legal/
    β”œβ”€β”€ 401K Prospectus.pdf
    β”œβ”€β”€ Employment Agreement.pdf
    └── Non-disclosure Agreement.pdf

Notice that they are converted to lowercase and anchorized:

β”œβ”€β”€ 401k-prospectus.pdf
β”œβ”€β”€ employment-agreement.pdf
β”œβ”€β”€ non-disclosure-agreement.pdf

https://github.com/gohugoio/hugo/issues/12182

1 Like

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