diff --git a/lib/metadata/update.ts b/lib/metadata/update.ts index f6168c1ae6..0171973cb7 100644 --- a/lib/metadata/update.ts +++ b/lib/metadata/update.ts @@ -5,8 +5,11 @@ import type { Route } from 'nextjs-routes'; import generate from './generate'; export default function update(route: R, apiData: ApiData) { - const { title, description } = generate(route, apiData); + const { title, description, opengraph } = generate(route, apiData); window.document.title = title; window.document.querySelector('meta[name="description"]')?.setAttribute('content', description); + window.document.querySelector('meta[property="og:title"]')?.setAttribute('content', opengraph.title); + opengraph.description && + window.document.querySelector('meta[property="og:description"]')?.setAttribute('content', opengraph.description); }