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

Fix template failure in bio.html when avatar cannot be found #15

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

MikeMoolenaar
Copy link
Contributor

@MikeMoolenaar MikeMoolenaar commented Mar 20, 2023

What problem does this PR solve?

Template error when params.author.avatar cannot be found.

Full error:

Start building sites … 
hugo v0.92.2+extended linux/amd64 BuildDate=2023-01-31T11:11:57Z VendorInfo=ubuntu:0.92.2-1ubuntu0.1  
Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template:   
index.html:8:15: executing "index.html" at <partial "bio" .>: error calling partial: "/home/mike/git/testblog  
/themes/hugo-blog-awesome/layouts/partials/bio.html:4:19": execute of template failed: template: partials/bio.html:4:19:   
executing "partials/bio.html" at <$image.Fill>: nil pointer evaluating resource.Resource.Fill  
Built in 17 ms

Is this PR adding a new feature?

No

Is this PR related to any issue or discussion?

No, hope that's ok. It's quicker to make a PR than opening up an issue.

PR Checklist

  • I have verified that the code works as described/as intended.
  • This change adds a social icon which has a permissive license to use it.
  • This change does not include any external library/resources.
  • This change does not include any unrelated scripts (e.g. bash and python scripts).
  • I have enabled maintainer edits for this PR.

Happens when params.author.avatar cannot be found
@netlify
Copy link

netlify bot commented Mar 20, 2023

👷 Deploy Preview for hugo-blog-awesome processing.

Name Link
🔨 Latest commit f580a78
🔍 Latest deploy log https://app.netlify.com/sites/hugo-blog-awesome/deploys/6418b86cd9962700084946ec

@MikeMoolenaar
Copy link
Contributor Author

Thanks for creating this btw, it looks great! :D

@hugo-sid
Copy link
Owner

hugo-sid commented Mar 20, 2023

Hi @MikeMoolenaar. Thanks for your contribution. That's a nice way to prevent errors, if someone doesn't want to use an image or if it is not found.

I appreciate your contribution to make this theme better.

Thanks for creating this btw, it looks great! :D

You are welcome @MikeMoolenaar.

Don't forget to star the repo, if you liked it.

Have a nice day.

@hugo-sid hugo-sid merged commit 295c8a1 into hugo-sid:main Mar 20, 2023
@MikeMoolenaar MikeMoolenaar deleted the dev branch March 20, 2023 20:08
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

Successfully merging this pull request may close these issues.

None yet

2 participants