From f32aa30f2f0722fb659a22ddc57cdf3bd79a4ab5 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 23 May 2025 15:07:50 +0200 Subject: Add blog pages, content and standardlayout --- src/pages/blog/index.astro | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/pages/blog/index.astro (limited to 'src/pages/blog/index.astro') diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro new file mode 100644 index 0000000..76b9f57 --- /dev/null +++ b/src/pages/blog/index.astro @@ -0,0 +1,48 @@ +--- +import StandardLayout from '../../layouts/StandardLayout.astro'; +import { getCollection } from 'astro:content'; + +// Get all blog posts sorted by publication date +const posts = await getCollection('blog'); +posts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); +--- + + +
+

Blog

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

No blog posts found. Check back soon!

+
+ )} +
+
-- cgit v1.3.1