commit 52872f85a5a6f052386dc65dc49370b8daf98b46
parent 8ada246522a86a0d8ae56a4f95f6b8358cc0129f
Author: Luke Jones <luke.jones.2567@gmail.com>
Date: Tue, 21 Jul 2026 23:39:34 +0100
feat: sort blogs by date
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro
@@ -8,6 +8,8 @@ const title = "Blog";
const posts = await getCollection('blog');
+posts.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
+
const postViewUrl = "/blog/"
const contentData = posts.map((post) => ({