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/index.astro | 83 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 8 deletions(-) (limited to 'src/pages/index.astro') diff --git a/src/pages/index.astro b/src/pages/index.astro index 22adfcf..a88712c 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,11 +1,78 @@ --- -import Counter from '../components/Counter'; -import CenteredLayout from '../layouts/CenteredLayout.astro'; +import Counter from "../components/Counter"; +import StandardLayout from "../layouts/StandardLayout.astro"; +import { getCollection } from "astro:content"; + +// Get the latest 3 blog posts +const latestPosts = await getCollection("blog"); +latestPosts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); +const featuredPosts = latestPosts.slice(0, 3); --- - -
-

Astro

- -
-
+ +
+
+

+ Welcome to Astro +

+

+ A modern framework for building fast, content-focused websites. +

+
+ +
+
+
+ +
+ +
+
-- cgit v1.3.1