gatsby-seo-example icon indicating copy to clipboard operation
gatsby-seo-example copied to clipboard

Default image for SEO if null

Open yansusanto opened this issue 6 years ago • 1 comments

If this

const metaImage = image && image.src ? `${data.site.siteMetadata.siteUrl}${image.src}` : null`

works on single post, how do I, if I may ask, set a default image if image is not specified on the template?

yansusanto avatar Sep 01 '19 06:09 yansusanto

If this

const metaImage = image && image.src ? `${data.site.siteMetadata.siteUrl}${image.src}` : null`

works on single post, how do I, if I may ask, set a default image if image is not specified on the template?

Couldn't you just import a default image as an asset and instead of returning null you return that image?

molebox avatar Sep 17 '19 13:09 molebox