rladies / rladies.github.io

R-Ladies Hugo Website
Other
11 stars 19 forks source link

dont fail on remote r-ladies blog image unavailable #333

Closed drmowinckels closed 5 months ago

drmowinckels commented 5 months ago

Will allow the website to build even if the image listed for the R-Ladies blog is no longer available. The image will be replaced with a random gravatar.

github-actions[bot] commented 5 months ago

Test build failed :sob: Check out the build logs.

github-actions[bot] commented 5 months ago

Test build failed :sob: Check out the build logs.

cosimameyer commented 5 months ago

Just thinking out loud: Based on the errors, I'm unsure whether Go templates actually support try-catch. Based in this issue, it looks like it doesn't. Maybe we can add a continue instead? (or something like this)?

drmowinckels commented 5 months ago

actually this partially works, and I'm unsure why its really failing. The code is more or less right out of hugo docs (https://gohugo.io/functions/resources/getremote/#error-handling) Locally, it manages to deal with incorrect image url just fine. And if you check the build, and click on the image links that are erroring, none of them actually exist (all are giving 404). I'm trying to understand what up and make a workaround in this PR, just not there yet, unfortunately.

github-actions[bot] commented 5 months ago

:tada: The preview is built! Check it out :eyes:

drmowinckels commented 5 months ago

found it! I needed to warn rather than error on missing image. Quite obviously :)