Skip to content

Commit

Permalink
Add basic Twitter card
Browse files Browse the repository at this point in the history
Twitter should fall back to Open Graph meta tags [1], but this doesn't seem
to work properly. This commit adds a basic "Summary" Twitter card using the same
title, image, and description as the Open Graph tags.

[1] https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started#opengraph
  • Loading branch information
psthomas committed Apr 4, 2020
1 parent 3473dfa commit 0af4f7b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions static-site/src/components/SEO/SEO.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class SEO extends Component {
property="fb:app_id"
content={config.siteFBAppID ? config.siteFBAppID : ""}
/>

{/* Twitter Card tags */}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={image} />
</Helmet>
);
}
Expand Down

0 comments on commit 0af4f7b

Please sign in to comment.