Compare commits
4 Commits
7cf1b4d16e
...
renovate/c
Author | SHA1 | Date | |
---|---|---|---|
|
e53257d23b | ||
5acb6a4f81 | |||
|
7b7a3cf2a0 | ||
ee25889139 |
@ -23,7 +23,7 @@
|
|||||||
"@vercel/og": "^0.6.3",
|
"@vercel/og": "^0.6.3",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "1.0.0",
|
"cmdk": "1.0.4",
|
||||||
"framer-motion": "^11.11.1",
|
"framer-motion": "^11.11.1",
|
||||||
"lucide-react": "^0.452.0",
|
"lucide-react": "^0.452.0",
|
||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
@ -43,7 +43,7 @@
|
|||||||
"@types/react": "^18",
|
"@types/react": "^18",
|
||||||
"@types/react-dom": "^18",
|
"@types/react-dom": "^18",
|
||||||
"eslint": "^8",
|
"eslint": "^8",
|
||||||
"eslint-config-next": "14.2.15",
|
"eslint-config-next": "15.0.0",
|
||||||
"postcss": "^8",
|
"postcss": "^8",
|
||||||
"tailwindcss": "^3.4.1",
|
"tailwindcss": "^3.4.1",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
@ -100,18 +100,19 @@ export const generateMetadata = async ({
|
|||||||
}): Promise<Metadata | undefined> => {
|
}): Promise<Metadata | undefined> => {
|
||||||
const slug: string = (((await params).slug as string[]) || undefined)?.join(
|
const slug: string = (((await params).slug as string[]) || undefined)?.join(
|
||||||
"/"
|
"/"
|
||||||
); // The slug of the content
|
);
|
||||||
if (slug) {
|
if (slug) {
|
||||||
const content: DocsContentMetadata | undefined = (
|
const pages: DocsContentMetadata[] = await getDocsContent();
|
||||||
await getDocsContent()
|
const decodedSlug: string = decodeURIComponent(slug || "");
|
||||||
).find(
|
const page: DocsContentMetadata | undefined = pages.find(
|
||||||
(metadata: DocsContentMetadata): boolean => metadata.slug === slug
|
(metadata: DocsContentMetadata): boolean =>
|
||||||
); // Get the content based on the provided slug
|
metadata.slug === (decodedSlug || pages[0].slug)
|
||||||
if (content) {
|
);
|
||||||
|
if (page) {
|
||||||
return Embed({
|
return Embed({
|
||||||
title: content.title,
|
title: page.title,
|
||||||
description: content.summary,
|
description: page.summary,
|
||||||
thumbnail: config.ogApiUrl.replace("{title}", content.title),
|
thumbnail: config.ogApiUrl.replace("{title}", page.title),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user