Skip to content

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

@regisphilibert

Description

@regisphilibert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions