diff options
-rw-r--r-- | src/pages/index.astro | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pages/index.astro b/src/pages/index.astro index 6df8f31..6575ca6 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -4,6 +4,7 @@ import Element from "../components/PostElement.astro"; import Layout from "../layouts/BaseLayout.astro"; const posts = await getCollection("blog"); +posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); --- <Layout> |