This commit is contained in:
2026-01-17 01:50:54 +01:00
parent c12b32ed5e
commit c8f61257c9
62 changed files with 1297 additions and 1028 deletions

View File

@@ -156,92 +156,99 @@ export default async function BlogPost({ params: { locale, slug } }: BlogPostPro
}
return (
<article className="bg-gradient-to-b from-neutral-light/30 to-white min-h-screen">
<article className="bg-white min-h-screen font-sans">
{/* Featured Image Header */}
{post.frontmatter.featuredImage && (
<div className="relative w-full h-[300px] md:h-[500px] overflow-hidden">
<img
src={post.frontmatter.featuredImage}
alt={post.frontmatter.title}
className="w-full h-full object-cover"
<div className="relative w-full h-[60vh] min-h-[400px] overflow-hidden group">
<div
className="absolute inset-0 bg-cover bg-center transition-transform duration-[2s] ease-out scale-105 group-hover:scale-100"
style={{ backgroundImage: `url(${post.frontmatter.featuredImage})` }}
/>
<div className="absolute inset-0 bg-gradient-to-t from-black/70 via-black/30 to-transparent" />
<div className="absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent" />
{/* Title overlay on image */}
<div className="absolute bottom-0 left-0 right-0 p-8 md:p-12">
<div className="container mx-auto max-w-4xl">
<div className="absolute inset-0 flex flex-col justify-end p-8 md:p-16 lg:p-24">
<div className="container mx-auto max-w-3xl">
{post.frontmatter.category && (
<span className="inline-block px-4 py-2 bg-primary text-white text-sm font-medium rounded-full mb-4">
<span className="inline-block px-4 py-1.5 bg-primary/90 backdrop-blur-sm text-white text-sm font-bold uppercase tracking-wider rounded-full mb-6 shadow-lg transform transition-transform hover:scale-105">
{post.frontmatter.category}
</span>
)}
<h1 className="text-3xl md:text-5xl lg:text-6xl font-bold text-white mb-4 leading-tight drop-shadow-lg">
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white mb-6 leading-tight drop-shadow-xl">
{post.frontmatter.title}
</h1>
<time dateTime={post.frontmatter.date} className="text-white/90 text-sm md:text-base">
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
year: 'numeric',
month: 'long',
day: 'numeric'
})}
</time>
<div className="flex items-center gap-4 text-white/90 text-sm md:text-base font-medium">
<time dateTime={post.frontmatter.date}>
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
year: 'numeric',
month: 'long',
day: 'numeric'
})}
</time>
<span className="w-1.5 h-1.5 bg-primary rounded-full" />
<span>KLZ Cables</span>
</div>
</div>
</div>
</div>
)}
{/* Content */}
<div className="container mx-auto px-4 py-12 md:py-16 max-w-4xl">
<div className="container mx-auto px-4 py-16 md:py-24 max-w-3xl">
{/* If no featured image, show header here */}
{!post.frontmatter.featuredImage && (
<header className="mb-12">
<header className="mb-16 text-center">
{post.frontmatter.category && (
<div className="mb-4">
<span className="inline-block px-4 py-2 bg-primary text-white text-sm font-medium rounded-full">
<div className="mb-6">
<span className="inline-block px-4 py-1.5 bg-primary/10 text-primary text-sm font-bold uppercase tracking-wider rounded-full">
{post.frontmatter.category}
</span>
</div>
)}
<h1 className="text-4xl md:text-5xl lg:text-6xl font-bold text-text-primary mb-6 leading-tight">
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-text-primary mb-8 leading-tight">
{post.frontmatter.title}
</h1>
<time dateTime={post.frontmatter.date} className="text-text-secondary">
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
year: 'numeric',
month: 'long',
day: 'numeric'
})}
</time>
<div className="flex items-center justify-center gap-4 text-text-secondary font-medium">
<time dateTime={post.frontmatter.date}>
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
year: 'numeric',
month: 'long',
day: 'numeric'
})}
</time>
<span className="w-1.5 h-1.5 bg-primary rounded-full" />
<span>KLZ Cables</span>
</div>
</header>
)}
{/* Excerpt/Lead paragraph if available */}
{post.frontmatter.excerpt && (
<div className="mb-12 p-6 md:p-8 bg-white rounded-xl shadow-sm border-l-4 border-primary">
<p className="text-xl md:text-2xl text-text-primary leading-relaxed font-light">
<div className="mb-16">
<p className="text-xl md:text-2xl text-text-primary leading-relaxed font-medium border-l-4 border-primary pl-6 py-2">
{post.frontmatter.excerpt}
</p>
</div>
)}
{/* Main content with enhanced styling */}
<div className="bg-white rounded-xl shadow-sm p-6 md:p-10">
<div className="prose prose-lg max-w-none">
<MDXRemote source={post.content} components={components} />
</div>
<div className="prose prose-lg md:prose-xl max-w-none prose-headings:font-bold prose-headings:text-text-primary prose-p:text-text-secondary prose-p:leading-relaxed prose-a:text-primary prose-a:no-underline hover:prose-a:underline prose-img:rounded-xl prose-img:shadow-lg">
<MDXRemote source={post.content} components={components} />
</div>
{/* Power CTA */}
<PowerCTA locale={locale} />
<div className="mt-20">
<PowerCTA locale={locale} />
</div>
{/* Post Navigation */}
<PostNavigation prev={prev} next={next} locale={locale} />
{/* Back to blog link */}
<div className="mt-12 pt-8 border-t border-neutral-dark/20 text-center">
<div className="mt-16 pt-10 border-t border-neutral-200 text-center">
<Link
href={`/${locale}/blog`}
className="inline-flex items-center gap-2 text-primary hover:underline font-medium text-lg group"
className="inline-flex items-center gap-2 text-text-secondary hover:text-primary font-medium text-lg transition-colors group"
>
<svg className="w-5 h-5 transition-transform group-hover:-translate-x-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />