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

Media: Investigate images with whitespace invoked with "%20" #69

Open
regisphilibert opened this issue May 12, 2022 · 0 comments
Open

Comments

@regisphilibert
Copy link
Member

regisphilibert commented May 12, 2022

In the event that an image whose filename contains whitespaces but is invoked (with resources.Get) using %20, Hugo (or Huge) fails to publish it.

For example this file is stored at /uploads/that image needs space.jpg

invocation  found published
huge/media/Get "/uploads/that image needs space.jpg" OK OK
huge/media/Get "/uploads/that%20image%20needs%20space.jpg" OK NO

Might be upstream, or not... hence the need to investigate.

The current solution implemented for a project is to replace the %20 before invoking:

{{ $destination := replace .Destination "%20" " " }}
{{ $image := partial "huge/media/Get" $destination }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant