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

@@ -16,22 +16,40 @@ export async function generateMetadata({ params: { locale, slug } }: BlogPostPro
if (!post) return {};
const description = post.frontmatter.excerpt || '';
const imageUrl = post.frontmatter.featuredImage || '/uploads/2025/02/og-2.webp';
return {
title: post.frontmatter.title,
description: description,
alternates: {
canonical: `/${locale}/blog/${slug}`,
languages: {
'de': `/de/blog/${slug}`,
'en': `/en/blog/${slug}`,
'x-default': `/en/blog/${slug}`,
},
},
openGraph: {
title: post.frontmatter.title,
title: `${post.frontmatter.title} | KLZ Cables`,
description: description,
type: 'article',
publishedTime: post.frontmatter.date,
authors: ['KLZ Cables'],
url: `https://klz-cables.com/${locale}/blog/${slug}`,
images: [
{
url: imageUrl,
width: 1200,
height: 630,
alt: post.frontmatter.title,
},
],
},
twitter: {
card: 'summary_large_image',
title: post.frontmatter.title,
title: `${post.frontmatter.title} | KLZ Cables`,
description: description,
images: [imageUrl],
},
};
}

View File

@@ -15,6 +15,33 @@ export async function generateMetadata({ params: { locale } }: BlogIndexProps) {
return {
title: t('title'),
description: t('description'),
alternates: {
canonical: `/${locale}/blog`,
languages: {
'de': '/de/blog',
'en': '/en/blog',
'x-default': '/en/blog',
},
},
openGraph: {
title: `${t('title')} | KLZ Cables`,
description: t('description'),
url: `https://klz-cables.com/${locale}/blog`,
images: [
{
url: '/uploads/2025/02/og-2.webp',
width: 1200,
height: 630,
alt: t('title'),
},
],
},
twitter: {
card: 'summary_large_image',
title: `${t('title')} | KLZ Cables`,
description: t('description'),
images: ['/uploads/2025/02/og-2.webp'],
},
};
}