mirror of
https://github.com/Xevion/undefined.behavio.rs.git
synced 2025-12-12 01:11:50 -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 Base from "@layouts/Base.astro";
|
||||||
import Summary from "@components/Summary.astro";
|
import Summary from "@components/Summary.astro";
|
||||||
const posts = await getCollection("blog");
|
const posts = await getCollection("blog");
|
||||||
|
posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base>
|
<Base>
|
||||||
|
|||||||
Reference in New Issue
Block a user