mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-15 03:35:42 +00:00
Ryan Freeman
6f1152b87a
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m43s
31 lines
705 B
TypeScript
31 lines
705 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: [
|
|
{
|
|
url: `/api/og-image?text=${meta.heading}`,
|
|
width: 1200,
|
|
height: 600,
|
|
alt: meta.heading,
|
|
type: 'image/png'
|
|
}
|
|
],
|
|
type: meta.type
|
|
}
|
|
}
|
|
}
|
|
|
|
export async function generateMetadata(meta: Meta) {
|
|
return metadata(meta)
|
|
} |