Skip to content

Commit

Permalink
fix: opengraph data in share (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaliCastle authored Oct 19, 2023
1 parent 5dcaa63 commit f33aae1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/share/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ export async function generateMetadata({
const user = filterUser(clerkUser)
const testId = getTestId({ date: userScore.createdAt })
const tier = getResultTier(userScore.score, userScore.total, userScore.time)
const title = user.name ? `${user.name} on isthat.ai` : undefined
const description = `I scored ${tier.title} on Test #${testId} 🕵️`

return {
title: user.name ? `${user.name} on isthat.ai` : undefined,
description: `I scored ${tier.title} on Test #${testId} 🕵️`,
title,
description,
openGraph: {
title,
description,
},
} satisfies Metadata
}

Expand Down

0 comments on commit f33aae1

Please sign in to comment.