mirror of
https://github.com/Xevion/undefined.behavio.rs.git
synced 2025-12-10 12:09:03 -06:00
Sort posts before rendering
This commit is contained in:
@@ -3,6 +3,7 @@ import { getCollection, getEntry } from "astro:content";
|
||||
import Base from "@layouts/Base.astro";
|
||||
import Summary from "@components/Summary.astro";
|
||||
const posts = await getCollection("blog");
|
||||
posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
|
||||
---
|
||||
|
||||
<Base>
|
||||
|
||||
Reference in New Issue
Block a user