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()); ---