Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/img/og-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 22 additions & 2 deletions theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const graphQLLogo = (
<GraphQLWordmarkLogo className="nextra-logo h-6" title="GraphQL" />
)

const absoluteUrl =
`https://${process.env.VERCEL_URL}` ||
process.env.__NEXT_PRIVATE_ORIGIN ||
"http://localhost:3000"

export default {
backgroundColor: {
light: "251,251,249",
Expand Down Expand Up @@ -42,9 +47,24 @@ export default {
</>
)}
{canonical && <link rel="canonical" href={canonical} />}
{image && <meta name="og:image" content={image} />}
<meta property="og:image" content="/img/og-image.png" />

<meta property="twitter:site" content="@graphql" />

{image ? (
<>
{/* if there is an OG image, we show a bigger card */}
<meta property="og:image" content={image} />
<meta name="twitter:card" content="summary_large_image" />
</>
) : (
<>
<meta
property="og:image"
content={`${absoluteUrl}/img/og-logo.png`}
/>
<meta name="twitter:card" content="summary" />
</>
)}
</>
)
},
Expand Down