Add a siteUrl
field to your gatsby-config
metadata. Together with an image src
, generate the URL for an image. Inside your SEO component, add an additional array to your Helmet meta
field that is only used when an image is available. Set the appropriate fields and the summary_large_image
Twitter card type so that the images will show up when shared on social sites.
Can we use StaticImage component in an MdX post ?
You cannot. Under the hood there is some babel stuff going on the conflicts with the MDX build process.
This nicely explains why I was not able to make it work then :wink: Thanks for the answer !
How would it work for a post with more than one image?
How would it work for a post with more than one image? SEO support is about the preview image that gets shown for a post when you share the link on a social site, etc. Therefore, only one image can be used.
This does not prevent you from using multiple images in the post itself.
Thanks! I think I posted under the wrong segment. I meant multiple images in a post, not for SEO.
Thanks! I think I posted under the wrong segment. I meant multiple images in a post, not for SEO.
Ah, got it. You certainly can. You can't have more than one image in the frontmatter unless you change your template. In most cases you'll want to include the images in the body of your MDX itself. Meaning you can treat it like a typical markdown image and use .
Thanks! I think I posted under the wrong segment. I meant multiple images in a post, not for SEO.
Ah, got it. You certainly can. You can't have more than one image in the frontmatter unless you change your template. In most cases you'll want to include the images in the body of your MDX itself. Meaning you can treat it like a typical markdown image and use .
Sorry, about that, this comment section converts markdown it seems! This is the type of syntax you'd use. https://www.markdownguide.org/basic-syntax/#images-1