TryGhost/eleventy-starter-ghost

Compiling breaks if author photo is unavailable

taurean opened this issue · 2 comments

Issue Summary

If you attempt to build an 11ty site using data from ghost that doesn't include a photo for the author image, eleventy will provide the error:

Having trouble writing template: dist/index.html

`TemplateWriterWriteError` was thrown
 The "path" argument must be of type string. Received type object

to circumvent this, wrap the author image html markup in the src/_includes/partials/card.njk file with {% if post.primary_author.profile_image %}{% endif %}.

Great catch @taurean! Would you be able to create a pull request? 😊

Done! #32