This commit is contained in:
2026-01-19 19:29:44 +01:00
parent 2feb73b982
commit 6797303628
15 changed files with 406 additions and 18 deletions

View File

@@ -34,30 +34,71 @@ export async function generateMetadata({ params }: ProductPageProps): Promise<Me
return {
title: categoryTitle,
description: categoryDesc,
alternates: {
canonical: `/${locale}/products/${productSlug}`,
languages: {
'de': `/de/products/${productSlug}`,
'en': `/en/products/${productSlug}`,
'x-default': `/en/products/${productSlug}`,
},
},
openGraph: {
title: categoryTitle,
title: `${categoryTitle} | KLZ Cables`,
description: categoryDesc,
url: `https://klz-cables.com/${locale}/products/${productSlug}`,
}
images: [
{
url: '/uploads/2025/02/og-2.webp',
width: 1200,
height: 630,
alt: categoryTitle,
},
],
},
twitter: {
card: 'summary_large_image',
title: `${categoryTitle} | KLZ Cables`,
description: categoryDesc,
images: ['/uploads/2025/02/og-2.webp'],
},
};
}
const product = await getProductBySlug(productSlug, locale);
if (!product) return {};
const imageUrl = product.frontmatter.images?.[0] || '/uploads/2025/02/og-2.webp';
return {
title: product.frontmatter.title,
description: product.frontmatter.description,
alternates: {
canonical: `/${locale}/products/${slug.join('/')}`,
languages: {
'de': `/de/products/${slug.join('/')}`,
'en': `/en/products/${slug.join('/')}`,
'x-default': `/en/products/${slug.join('/')}`,
},
},
openGraph: {
title: product.frontmatter.title,
title: `${product.frontmatter.title} | KLZ Cables`,
description: product.frontmatter.description,
type: 'website',
url: `https://klz-cables.com/${locale}/products/${slug.join('/')}`,
images: [
{
url: imageUrl,
width: 1200,
height: 630,
alt: product.frontmatter.title,
},
],
},
twitter: {
card: 'summary_large_image',
title: product.frontmatter.title,
title: `${product.frontmatter.title} | KLZ Cables`,
description: product.frontmatter.description,
images: [imageUrl],
},
};
}