hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
1.05k stars 607 forks source link

Minor bug with default avatar file and configuration guide #291

Closed s0m3guy closed 10 months ago

s0m3guy commented 3 years ago

Expected Behavior

hugo server should start with no issues when following the configuration guide here: https://toha-guides.netlify.app/posts/configuration/site-parameters/

Current Behavior

When executing hugo server -t toha -w after setting up the author.yaml file for the first time with the content from the guide, you get the following in the terminal:

Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: index.html:39:8: executing "index.html" at <partial "sections/home.html" .>: error calling partial: "xxx\hugo\quickstart\themes\toha\layouts\partials\sections\home.html:29:31": execute of template failed: template: partials/sections/home.html:29:31: executing "partials/sections/home.html" at <$authorImage.Fit>: nil pointer evaluating resource.Resource.Fit

Possible Solution

What fixed this was changing the line in author.yaml from

image: "images/avatar.png"

to

image: "images/default-avatar.png"

Steps to Reproduce

Freshly install the toha theme and follow the guide here and if you follow closely with copy paste you should encounter the error message above after the step with the author.yaml file.

Screenshots

Browsers Affected

Detailed Description

I think changing this little line in the configuration guide should help.

Nirzak commented 3 years ago

I don't think there's any error on author.yaml. The render error only occurs when you wrongly specifies any file path to author or site.yaml. Please check the image you provided is exactly with that name "avatar.png" or "avatar.jpg" if not then correctly rename your avatar file and correctly place it on the static folder thanks.

Rihoj commented 3 years ago

I can not see any bug with the documentation. The images/avatar.png file location should not be in the theme directory, but in your site's assets/ directory.

You can see how the guide is storing the images here

KHannibal commented 2 years ago

I had the same issue as @s0m3guy and @Rihoj 's post helped me fix (temporarily maybe) the issue.