{featuredPost.frontmatter.title}
{featuredPost.frontmatter.excerpt}
import Link from 'next/link'; import { getAllPosts } from '@/lib/blog'; import { getTranslations } from 'next-intl/server'; interface BlogIndexProps { params: { locale: string; }; } export async function generateMetadata({ params: { locale } }: BlogIndexProps) { return { title: locale === 'de' ? 'Neuigkeiten zu Kabeln und Energielösungen' : 'News on Cables and Energy Solutions', description: locale === 'de' ? 'Bleiben Sie auf dem Laufenden! Lesen Sie aktuelle Themen und Insights zu Kabeltechnologie, Energielösungen und branchenspezifischen Innovationen.' : 'Stay up to date! Read current topics and insights on cable technology, energy solutions and industry-specific innovations.', }; } export default async function BlogIndex({ params: { locale } }: BlogIndexProps) { const posts = await getAllPosts(locale); // Sort posts by date descending const sortedPosts = [...posts].sort((a, b) => new Date(b.frontmatter.date).getTime() - new Date(a.frontmatter.date).getTime() ); const featuredPost = sortedPosts[0]; const remainingPosts = sortedPosts.slice(1); return (
{locale === 'de' ? 'Insights, News und technisches Know-how aus der Welt der Kabelinfrastruktur und erneuerbaren Energien.' : 'Insights, news and technical know-how from the world of cable infrastructure and renewable energies.'}
{featuredPost.frontmatter.excerpt}
{post.frontmatter.excerpt}