Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Nov 20, 2024
1 parent e8a7d5f commit 4503a07
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions app/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,24 @@ export const generateMetadata = async ({ params }: PageProps) => {

const components = ['calendar', 'gantt', 'kanban', 'list', 'table'];

return {
const metadata: Metadata = {
title: page.data.title,
description: page.data.description,
openGraph: {
images:
slug && components.includes(slug[0])
? [
{
url: `/og/${slug[0]}.png`,
},
]
: undefined,
},
} satisfies Metadata;
};

if (slug && components.includes(slug[0])) {
metadata.openGraph = {
images: [
{
url: `/og/${slug[0]}.png`,
width: 1200,
height: 630,
},
],
};
}

return metadata;
};

export default Page;

0 comments on commit 4503a07

Please sign in to comment.