diff --git a/src/pages/categories/[category]/[...page].astro b/src/pages/categories/[category]/[...page].astro index a44f65e..54ba732 100644 --- a/src/pages/categories/[category]/[...page].astro +++ b/src/pages/categories/[category]/[...page].astro @@ -6,6 +6,7 @@ import { getAllPosts, getUniqueCategories } from "@/data/post"; import PageLayout from "@/layouts/Base.astro"; import { collectionDateSort } from "@/utils/date"; import type { GetStaticPaths, Page } from "astro"; +import { MAX_POSTS_PER_PAGE } from "@/utils/constant"; export const getStaticPaths: GetStaticPaths = async ({ paginate }) => { const allPosts = await getAllPosts(); @@ -17,7 +18,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => { category === "未分类" ? !post.data.category : post.data.category === category ); return paginate(filterPosts, { - pageSize: 20, + pageSize: MAX_POSTS_PER_PAGE, params: { category }, }); }); diff --git a/src/pages/tags/[tag]/[...page].astro b/src/pages/tags/[tag]/[...page].astro index 8006b60..0050f3b 100644 --- a/src/pages/tags/[tag]/[...page].astro +++ b/src/pages/tags/[tag]/[...page].astro @@ -6,6 +6,7 @@ import { getAllPosts, getUniqueTags } from "@/data/post"; import PageLayout from "@/layouts/Base.astro"; import { collectionDateSort } from "@/utils/date"; import type { GetStaticPaths, Page } from "astro"; +import { MAX_CATEGORIES } from "@/utils/constant"; export const getStaticPaths: GetStaticPaths = async ({ paginate }) => { const allPosts = await getAllPosts(); @@ -15,7 +16,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => { return uniqueTags.flatMap((tag) => { const filterPosts = sortedPosts.filter((post) => post.data.tags.includes(tag)); return paginate(filterPosts, { - pageSize: 20, + pageSize: MAX_CATEGORIES, params: { tag }, }); });