diff --git a/src/pages/articles/[...slug].astro b/src/pages/articles/[...slug].astro index be8f35d..79a673d 100644 --- a/src/pages/articles/[...slug].astro +++ b/src/pages/articles/[...slug].astro @@ -11,9 +11,9 @@ interface Props { } export async function getStaticPaths() { - const articles = await getCollection("articles", ({data}) => { + const articles = (await getCollection("articles", ({ data }) => { return data.published !== false; - }); + })).sort((a, b) => b.data.publishedDate?.valueOf() - a.data.publishedDate?.valueOf()); const numberOfPosts = articles.length; diff --git a/src/pages/notes/[...slug].astro b/src/pages/notes/[...slug].astro index 602fa6d..cc13d00 100644 --- a/src/pages/notes/[...slug].astro +++ b/src/pages/notes/[...slug].astro @@ -18,9 +18,9 @@ interface Props { // } export async function getStaticPaths() { - const notes = await getCollection("posts", ({ data }) => { + const notes = (await getCollection("posts", ({ data }) => { return data.published !== false; - }); + })).sort((a, b) => b.data.publishedDate?.valueOf() - a.data.publishedDate?.valueOf()); const numberOfPosts = notes.length;