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

Default image for SEO if null #2

Open
yansusanto opened this issue Sep 1, 2019 · 1 comment
Open

Default image for SEO if null #2

yansusanto opened this issue Sep 1, 2019 · 1 comment

Comments

@yansusanto
Copy link

yansusanto commented Sep 1, 2019

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 yansusanto changed the title Default image for SEO if Default image for SEO if null Sep 1, 2019
@molebox
Copy link

molebox commented Sep 17, 2019

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?

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

No branches or pull requests

2 participants