portfolio/lib/generateMetadata.ts
Ryan Freeman 0ef777edce
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m46s
Update metatags
2024-10-21 22:17:17 +01:00

29 lines
715 B
TypeScript

type Meta = {
title: string
heading: string
description: string
type: string
[name: string]: string | Object
}
export const metadata = (meta: Meta) => {
return {
...meta,
openGraph: {
title: meta.title,
description: meta.description,
images: meta.images
? meta.images
: [
{
url: `/api/og-image?text=${meta.heading}`,
width: 1200,
height: 600,
alt: meta.heading,
type: 'image/png'
}
],
type: meta.type
}
}
}