diff --git a/app/[locale]/blog/[slug]/page.tsx b/app/[locale]/blog/[slug]/page.tsx
index 0bd41e50..81e18cca 100644
--- a/app/[locale]/blog/[slug]/page.tsx
+++ b/app/[locale]/blog/[slug]/page.tsx
@@ -54,7 +54,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
const { locale, slug } = await params;
setRequestLocale(locale);
const post = await getPostBySlug(slug, locale);
- const { prev, next } = await getAdjacentPosts(slug, locale);
+ const { prev, next, isPrevRandom, isNextRandom } = await getAdjacentPosts(slug, locale);
if (!post) {
notFound();
@@ -70,11 +70,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
category={post.frontmatter.category}
readingTime={getReadingTime(post.content)}
/>
- {(new Date(post.frontmatter.date) > new Date() || post.frontmatter.public === false) && (
-
- Preview (Not visible in production)
-
- )}
+
{/* Featured Image Header */}
{post.frontmatter.featuredImage ? (
@@ -114,6 +110,12 @@ export default async function BlogPost({ params }: BlogPostProps) {
{getReadingTime(post.content)} min read
+ {(new Date(post.frontmatter.date) > new Date() || post.frontmatter.public === false) && (
+ <>
+
+ Draft Preview
+ >
+ )}
@@ -142,6 +144,12 @@ export default async function BlogPost({ params }: BlogPostProps) {
{getReadingTime(post.content)} min read
+ {(new Date(post.frontmatter.date) > new Date() || post.frontmatter.public === false) && (
+ <>
+
+ Draft Preview
+ >
+ )}
@@ -173,7 +181,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
{/* Post Navigation */}
{/* Back to blog link */}
diff --git a/app/[locale]/blog/page.tsx b/app/[locale]/blog/page.tsx
index bb9d3804..01e00e69 100644
--- a/app/[locale]/blog/page.tsx
+++ b/app/[locale]/blog/page.tsx
@@ -62,7 +62,7 @@ export default async function BlogIndex({ params }: BlogIndexProps) {
{featuredPost && featuredPost.frontmatter.featuredImage && (
<>
new Date() ||
featuredPost.frontmatter.public === false) && (
-
- Preview
+
+ Draft Preview
)}
@@ -160,7 +160,7 @@ export default async function BlogIndex({ params }: BlogIndexProps) {
{post.frontmatter.featuredImage && (
)}
- {(new Date(post.frontmatter.date) > new Date() ||
- post.frontmatter.public === false) && (
-
- Preview
-
- )}
+
)}
-
- {new Date(post.frontmatter.date).toLocaleDateString(locale, {
- year: 'numeric',
- month: 'long',
- day: 'numeric',
- })}
+
+
+ {new Date(post.frontmatter.date).toLocaleDateString(locale, {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric',
+ })}
+
+ {(new Date(post.frontmatter.date) > new Date() ||
+ post.frontmatter.public === false) && (
+ Draft
+ )}
{post.frontmatter.title}
diff --git a/components/blog/PostNavigation.tsx b/components/blog/PostNavigation.tsx
index 9fadcaee..f7d7eed5 100644
--- a/components/blog/PostNavigation.tsx
+++ b/components/blog/PostNavigation.tsx
@@ -5,43 +5,47 @@ import { PostMdx } from '@/lib/blog';
interface PostNavigationProps {
prev: PostMdx | null;
next: PostMdx | null;
+ isPrevRandom?: boolean;
+ isNextRandom?: boolean;
locale: string;
}
-export default function PostNavigation({ prev, next, locale }: PostNavigationProps) {
+export default function PostNavigation({ prev, next, isPrevRandom, isNextRandom, locale }: PostNavigationProps) {
if (!prev && !next) return null;
return (
{/* Previous Post (Older) */}
{prev ? (
-
{/* Background Image */}
{prev.frontmatter.featuredImage ? (
-
) : (
)}
-
+
{/* Overlay */}
-
+
{/* Content */}
- {locale === 'de' ? 'Vorheriger Beitrag' : 'Previous Post'}
+ {isPrevRandom
+ ? (locale === 'de' ? 'Weiterer Artikel' : 'More Article')
+ : (locale === 'de' ? 'Vorheriger Beitrag' : 'Previous Post')}
{prev.frontmatter.title}
-
+
{/* Arrow Icon */}