From e828f9f5903cc47682f967ba04741be93d97287b Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Sat, 2 Dec 2023 09:37:44 +0000 Subject: [PATCH] Order tag posts by descending date --- src/_data/tags.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_data/tags.js b/src/_data/tags.js index a0a90c3..aff7c0f 100644 --- a/src/_data/tags.js +++ b/src/_data/tags.js @@ -5,7 +5,7 @@ module.exports = async () => { const cache = await postCache(); return Object.values(cache.tags).map(tag => { - const posts = Object.values(cache.posts).filter(post => post.tags.includes(tag.id)); + const posts = Object.values(cache.posts).filter(post => post.tags.includes(tag.id)).sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()); return { ...tag,