Sort blog posts by publication date
This commit is contained in:
parent
4ac7da1231
commit
3591bebabf
@ -4,6 +4,7 @@ import Element from "../components/PostElement.astro";
|
|||||||
import Layout from "../layouts/BaseLayout.astro";
|
import Layout from "../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
const posts = await getCollection("blog");
|
const posts = await getCollection("blog");
|
||||||
|
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user