Skip to content

Instantly share code, notes, and snippets.

@seldo
Last active January 6, 2020 00:33
Show Gist options
  • Save seldo/845a5f54fe83a35a39ccb276985c22c2 to your computer and use it in GitHub Desktop.
Save seldo/845a5f54fe83a35a39ccb276985c22c2 to your computer and use it in GitHub Desktop.
Corrected twitter card for Gatsby
return (
<Helmet
htmlAttributes={{
lang,
}}
title={title}
titleTemplate={`%s`}
meta={[
{
name: `description`,
content: site.siteMetadata.description,
},
{
property: `og:title`,
content: title,
},
{
property: `og:description`,
content: metaDescription,
},
{
property: `og:type`,
content: `website`,
},
{
property: `twitter:image`,
content: `https://example.com/a_full_image_url_goes_here.jpg`
},
{
property: `twitter:image:alt`,
content: `A beautiful photograph`
},
{
name: `twitter:card`,
content: `summary_large_image`,
},
{
name: `twitter:site`,
content: site.siteMetadata.author,
},
{
name: `twitter:title`,
content: title,
},
{
name: `twitter:description`,
content: site.siteMetadata.description,
},
].concat(meta)}
/>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment