diff --git a/src/pages/posts/[...page].astro b/src/pages/posts/[...page].astro index 0f163e762..b61163949 100644 --- a/src/pages/posts/[...page].astro +++ b/src/pages/posts/[...page].astro @@ -3,10 +3,11 @@ import { SITE } from "@config"; import Posts from "@layouts/Posts.astro"; import type { GetStaticPaths } from "astro"; import { getCollection } from "astro:content"; +import getSortedPosts from "@utils/getSortedPosts"; export const getStaticPaths = (async ({ paginate }) => { const posts = await getCollection("blog", ({ data }) => !data.draft); - return paginate(posts, { pageSize: SITE.postPerPage }); + return paginate(getSortedPosts(posts), { pageSize: SITE.postPerPage }); }) satisfies GetStaticPaths; const { page } = Astro.props; diff --git a/src/pages/posts/[page].astro b/src/pages/posts/[page].astro index 0f163e762..b61163949 100644 --- a/src/pages/posts/[page].astro +++ b/src/pages/posts/[page].astro @@ -3,10 +3,11 @@ import { SITE } from "@config"; import Posts from "@layouts/Posts.astro"; import type { GetStaticPaths } from "astro"; import { getCollection } from "astro:content"; +import getSortedPosts from "@utils/getSortedPosts"; export const getStaticPaths = (async ({ paginate }) => { const posts = await getCollection("blog", ({ data }) => !data.draft); - return paginate(posts, { pageSize: SITE.postPerPage }); + return paginate(getSortedPosts(posts), { pageSize: SITE.postPerPage }); }) satisfies GetStaticPaths; const { page } = Astro.props;