Skip to content

Commit c9e0f83

Browse files
committed
add twitter meta tags
1 parent 96ac3d1 commit c9e0f83

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

gatsby-config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const config: GatsbyConfig = {
66
title: "Browser Actions",
77
description: "GitHub Actions for Browsers",
88
siteUrl: "https://browser-actions.github.io",
9+
social: {
10+
twitter: "ueokande",
11+
},
912
},
1013
graphqlTypegen: true,
1114
plugins: [

src/components/seo.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ query Site {
1818
title
1919
description
2020
siteUrl
21+
social {
22+
twitter
23+
}
2124
}
2225
}
2326
cover: file(relativePath: { eq: "cover.png" }) {
@@ -43,6 +46,15 @@ query Site {
4346
<meta property="og:image" content={coverUrl} />
4447
<meta property="og:description" content={metaDescription} />
4548
<meta property="og:type" content="website" />
49+
{site.siteMetadata?.social?.twitter && (
50+
<meta
51+
name="twitter:creator"
52+
content={`@${site.siteMetadata.social.twitter}`}
53+
/>
54+
)}
55+
<meta name="twitter:title" content={title} />
56+
<meta name="twitter:description" content={metaDescription} />
57+
<meta name="twitter:image" content={coverUrl} />
4658
{children}
4759
</>
4860
);

0 commit comments

Comments
 (0)