From a320d0fafd163e844a297babe6d89e87b3593a74 Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Tue, 28 Jul 2026 09:03:32 +0000 Subject: [PATCH] Deploy --- src/app/blog/page.tsx | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/app/blog/page.tsx diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx new file mode 100644 index 0000000..cdf950d --- /dev/null +++ b/src/app/blog/page.tsx @@ -0,0 +1,52 @@ +import Link from 'next/link' +import Image from 'next/image' +import { getBlogPosts } from '@/lib/cms' + +export const revalidate = 60 + +export default async function BlogPage() { + const posts = await getBlogPosts(20) + + return ( +
+
+
+ ← Home +

Blog

+
+ + {posts.length === 0 ? ( +

No posts published yet.

+ ) : ( +
+ {posts.map(post => { + const { title, excerpt, cover_image, author, category } = post.data as { + title?: string; excerpt?: string; cover_image?: string; author?: string; category?: string + } + const date = post.publishedAt + ? new Date(post.publishedAt).toLocaleDateString('en-ZA', { month: 'short', day: 'numeric', year: 'numeric' }) + : '' + return ( + + {cover_image && ( +
+ {title +
+ )} + {category && {category}} +

{title}

+ {excerpt &&

{excerpt}

} +
+ {author && {author}} + {author && date && ·} + {date && {date}} +
+ + ) + })} +
+ )} +
+
+ ) +}