File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,11 @@ import { SITE } from "@config";
33import Posts from " @layouts/Posts.astro" ;
44import type { GetStaticPaths } from " astro" ;
55import { getCollection } from " astro:content" ;
6+ import getSortedPosts from " @utils/getSortedPosts" ;
67
78export const getStaticPaths = (async ({ paginate }) => {
89 const posts = await getCollection (" blog" , ({ data }) => ! data .draft );
9- return paginate (posts , { pageSize: SITE .postPerPage });
10+ return paginate (getSortedPosts ( posts ) , { pageSize: SITE .postPerPage });
1011}) satisfies GetStaticPaths ;
1112
1213const { page } = Astro .props ;
Original file line number Diff line number Diff line change @@ -3,10 +3,11 @@ import { SITE } from "@config";
33import Posts from " @layouts/Posts.astro" ;
44import type { GetStaticPaths } from " astro" ;
55import { getCollection } from " astro:content" ;
6+ import getSortedPosts from " @utils/getSortedPosts" ;
67
78export const getStaticPaths = (async ({ paginate }) => {
89 const posts = await getCollection (" blog" , ({ data }) => ! data .draft );
9- return paginate (posts , { pageSize: SITE .postPerPage });
10+ return paginate (getSortedPosts ( posts ) , { pageSize: SITE .postPerPage });
1011}) satisfies GetStaticPaths ;
1112
1213const { page } = Astro .props ;
You can’t perform that action at this time.
0 commit comments