File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ const graphQLLogo = (
1212 < GraphQLWordmarkLogo className = "nextra-logo h-6" title = "GraphQL" />
1313)
1414
15+ const absoluteUrl =
16+ `https://${ process . env . VERCEL_URL } ` ||
17+ process . env . __NEXT_PRIVATE_ORIGIN ||
18+ "http://localhost:3000"
19+
1520export default {
1621 backgroundColor : {
1722 light : "251,251,249" ,
@@ -42,9 +47,24 @@ export default {
4247 </ >
4348 ) }
4449 { canonical && < link rel = "canonical" href = { canonical } /> }
45- { image && < meta name = "og:image" content = { image } /> }
46- < meta property = "og:image" content = "/img/og-image.png" />
50+
4751 < meta property = "twitter:site" content = "@graphql" />
52+
53+ { image ? (
54+ < >
55+ { /* if there is an OG image, we show a bigger card */ }
56+ < meta property = "og:image" content = { image } />
57+ < meta name = "twitter:card" content = "summary_large_image" />
58+ </ >
59+ ) : (
60+ < >
61+ < meta
62+ property = "og:image"
63+ content = { `${ absoluteUrl } /img/og-logo.png` }
64+ />
65+ < meta name = "twitter:card" content = "summary" />
66+ </ >
67+ ) }
4868 </ >
4969 )
5070 } ,
You can’t perform that action at this time.
0 commit comments