diff options
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/posts/[...page].astro | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pages/posts/[...page].astro b/src/pages/posts/[...page].astro index e07bc29..acca040 100644 --- a/src/pages/posts/[...page].astro +++ b/src/pages/posts/[...page].astro @@ -12,8 +12,9 @@ export const getStaticPaths = (async ({ paginate }) => { const MAX_POSTS_PER_PAGE = 10; const MAX_TAGS = 7; const allPosts = await getAllPosts(); - const uniqueTags = getUniqueTags(allPosts).slice(0, MAX_TAGS); - return paginate(allPosts.sort(collectionDateSort), { + const sortedPosts = allPosts.sort(collectionDateSort); + const uniqueTags = getUniqueTags(sortedPosts).slice(0, MAX_TAGS); + return paginate(sortedPosts, { pageSize: MAX_POSTS_PER_PAGE, props: { uniqueTags }, }); |
