import Link from 'next/link'; import { getAllPosts } from '@/lib/blog'; import { Section, Container, Heading, Card, Badge, Button } from '@/components/ui'; import Reveal from '@/components/Reveal'; 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 (
{featuredPost.frontmatter.excerpt}
> )}{post.frontmatter.excerpt}