Skip to content

[Bug]: In the config, in imageProfileMode, error when setting only one dimension #1780

@gijoe88

Description

@gijoe88

What happened?

I'm getting the error Error: error building site: render: failed to render pages: render of "/home/reivax/gitRepos/gijoe88/content/en-us/_index.md" failed: "/home/reivax/gitRepos/gijoe88/themes/PaperMod/layouts/_default/list.html:4:4": execute of template failed: template: list.html:4:4: executing "main" at <partial "index_profile.html" .>: error calling partial: "/home/reivax/gitRepos/gijoe88/themes/PaperMod/layouts/partials/index_profile.html:17:35": execute of template failed: template: _partials/index_profile.html:17:35: executing "_partials/index_profile.html" at <$img.Resize>: error calling Resize: strconv.Atoi: parsing "%!d(<nil>)": invalid syntax

Steps to reproduce

When setting only one image dimension in the imageProfileMode, for example here, with a local image in the assets folder, there is an error when Hugo is parsing the site.

With this configuration (on my site, not yet published) :

    params:
      languageAltTitle: English (US)
      profileMode:
        enabled: true
        title: "Welcome to my home"
        imageUrl: "me.jpg"
        imageTitle: Me
        imageHeight: 400
        # imageWidth: 400

AND with the image "me.jpg" in the assets folder,
AND launching the command hugo in production hugo server --environment production

The error is occuring.

Hugo Version

Hugo >= 0.146.0 (Recommended - Minimum version required for PaperMod)

PaperMod Version

5a46517 (branch master)

What kind of devices are you seeing the problem on?

No response

What browsers are you seeing the problem on?

No response

Browser Version

No response

Relevant log output

Error: error building site: render: failed to render pages: render of "/home/reivax/gitRepos/gitlab.gijoe88.com/gijoe88/xreveillon/content/en-us/_index.md" failed: "/home/reivax/gitRepos/gitlab.gijoe88.com/gijoe88/xreveillon/themes/PaperMod/layouts/_default/list.html:4:4": execute of template failed: template: list.html:4:4: executing "main" at <partial "index_profile.html" .>: error calling partial: "/home/reivax/gitRepos/gitlab.gijoe88.com/gijoe88/xreveillon/themes/PaperMod/layouts/partials/index_profile.html:17:35": execute of template failed: template: _partials/index_profile.html:17:35: executing "_partials/index_profile.html" at <$img.Resize>: error calling Resize: strconv.Atoi: parsing "%!d(<nil>)": invalid syntax

Repository/Source Code link where this issue can be reproduced

# imageWidth: 120

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions