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

@@ -2,6 +2,7 @@ import { notFound } from 'next/navigation';
import { MDXRemote } from 'next-mdx-remote/rsc';
import { Section, Container, Heading, Badge } from '@/components/ui';
import { getTranslations } from 'next-intl/server';
import { Metadata } from 'next';
interface PageProps {
params: {
@@ -10,6 +11,45 @@ interface PageProps {
};
}
export async function generateMetadata({ params: { locale, slug } }: PageProps): Promise<Metadata> {
const { getPageBySlug } = await import('@/lib/pages');
const pageData = await getPageBySlug(slug, locale);
if (!pageData) return {};
return {
title: pageData.frontmatter.title,
description: pageData.frontmatter.excerpt || '',
alternates: {
canonical: `/${locale}/${slug}`,
languages: {
'de': `/de/${slug}`,
'en': `/en/${slug}`,
'x-default': `/en/${slug}`,
},
},
openGraph: {
title: `${pageData.frontmatter.title} | KLZ Cables`,
description: pageData.frontmatter.excerpt || '',
url: `https://klz-cables.com/${locale}/${slug}`,
images: [
{
url: '/uploads/2025/02/og-2.webp',
width: 1200,
height: 630,
alt: pageData.frontmatter.title,
},
],
},
twitter: {
card: 'summary_large_image',
title: `${pageData.frontmatter.title} | KLZ Cables`,
description: pageData.frontmatter.excerpt || '',
images: ['/uploads/2025/02/og-2.webp'],
},
};
}
export default async function StandardPage({ params: { locale, slug } }: PageProps) {
const { getPageBySlug } = await import('@/lib/pages');
const pageData = await getPageBySlug(slug, locale);