From 875d33f1d98083bf9ba897238db6ecf19efe03c1 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 25 Jan 2024 22:36:09 -0500 Subject: Giving blog style --- src/pages/blog/index.astro | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/pages') diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index 1ebc9e9..94687fa 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -1,19 +1,35 @@ --- import Page from "../../layouts/Page.astro"; import { getCollection } from "astro:content"; +import {formatDate} from "../../util"; -const allBlogPosts = await getCollection('blog'); +const allBlogPosts = (await getCollection('blog')).sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()); ---
{allBlogPosts.map((post) => ( - )) + )) + }
+ -- cgit v1.2.3