Closed s0m3guy closed 10 months 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.
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
I had the same issue as @s0m3guy and @Rihoj 's post helped me fix (temporarily maybe) the issue.
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 theauthor.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
fromimage: "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.