Compare commits
4 Commits
7cf1b4d16e
...
renovate/r
Author | SHA1 | Date | |
---|---|---|---|
|
e6c4bfd962 | ||
5acb6a4f81 | |||
|
7b7a3cf2a0 | ||
ee25889139 |
@ -40,10 +40,10 @@
|
||||
"devDependencies": {
|
||||
"@types/luxon": "^3.4.2",
|
||||
"@types/node": "^22.0.0",
|
||||
"@types/react": "^18",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^18",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "14.2.15",
|
||||
"eslint-config-next": "15.0.0",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5"
|
||||
|
@ -100,18 +100,19 @@ export const generateMetadata = async ({
|
||||
}): Promise<Metadata | undefined> => {
|
||||
const slug: string = (((await params).slug as string[]) || undefined)?.join(
|
||||
"/"
|
||||
); // The slug of the content
|
||||
);
|
||||
if (slug) {
|
||||
const content: DocsContentMetadata | undefined = (
|
||||
await getDocsContent()
|
||||
).find(
|
||||
(metadata: DocsContentMetadata): boolean => metadata.slug === slug
|
||||
); // Get the content based on the provided slug
|
||||
if (content) {
|
||||
const pages: DocsContentMetadata[] = await getDocsContent();
|
||||
const decodedSlug: string = decodeURIComponent(slug || "");
|
||||
const page: DocsContentMetadata | undefined = pages.find(
|
||||
(metadata: DocsContentMetadata): boolean =>
|
||||
metadata.slug === (decodedSlug || pages[0].slug)
|
||||
);
|
||||
if (page) {
|
||||
return Embed({
|
||||
title: content.title,
|
||||
description: content.summary,
|
||||
thumbnail: config.ogApiUrl.replace("{title}", content.title),
|
||||
title: page.title,
|
||||
description: page.summary,
|
||||
thumbnail: config.ogApiUrl.replace("{title}", page.title),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user