Skip to content

Commit 7c1dbd7

Browse files
committed
pages/blog/tags/index.astro: sort posts before extracting tags for deterministic order
1 parent faa5cbe commit 7c1dbd7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pages/blog/tags/index.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import TitleCard from "@/components/ui/TitleCard.astro";
44
import Layout from "@/layouts/Layout.astro";
55
import { getCollection } from "astro:content";
66
7-
const allPosts = await getCollection("blog");
7+
const allPosts = (await getCollection("blog")).sort((a, b) =>
8+
a.id.localeCompare(b.id),
9+
);
810
const tags = [...new Set(allPosts.flatMap((post) => post.data.tags))].filter(
911
(tag) => tag !== undefined,
1012
);

0 commit comments

Comments
 (0)