tangled
alpha
login
or
join now
bwc9876.dev
/
website
0
fork
atom
Files for my website
bwc9876.dev
0
fork
atom
overview
issues
pulls
pipelines
Fix sorting on blog posts
bwc9876.dev
2 years ago
d244bfea
61b9b90c
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+3
-1
1 changed file
expand all
collapse all
unified
split
src
pages
blog
index.astro
+3
-1
src/pages/blog/index.astro
···
2
2
import Layout from "@layouts/Layout.astro";
3
3
import { getCollection } from "astro:content";
4
4
5
5
-
const blogEntries = await getCollection("posts");
5
5
+
const blogEntries = (await getCollection("posts"));
6
6
+
7
7
+
blogEntries.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
6
8
---
7
9
8
10
<Layout title="The Cowsay - Ben C's Blog">