diff --git a/src/pages/shared-metadata.ts b/src/pages/shared-metadata.ts new file mode 100644 index 0000000..3c500e8 --- /dev/null +++ b/src/pages/shared-metadata.ts @@ -0,0 +1,40 @@ +import { Metadata } from "next"; + +type Props = { + params: { + title: string; + description: string; + image: string; + twitterDescription: string; + twitterCard: "summary"; + twitterTitle: string; + twitterImage: string; + }; +}; + +export async function generateMetadata({ + params: { + description, + image, + title, + twitterCard, + twitterDescription, + twitterImage, + twitterTitle, + }, +}: Props): Promise { + return { + title, + description, + openGraph: { + title, + images: image, + }, + twitter: { + images: twitterImage, + title: twitterTitle, + description: twitterDescription, + card: twitterCard, + }, + }; +}