feat: update pagesize

This commit is contained in:
KazooTTT
2024-10-11 13:05:50 +08:00
parent d825b447fa
commit acf74dac51
4 changed files with 8 additions and 3 deletions

View File

@ -10,6 +10,11 @@
"astro": "astro",
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,svelte,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,svelte,astro}\""
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"dependencies": {
"@astrojs/check": "^0.5.6",
"@astrojs/mdx": "^2.1.1",

View File

@ -15,7 +15,7 @@ export const getStaticPaths = (async ({ paginate }) => {
const allPostsByDate = sortMDByDate(allPosts)
const uniqueTags = getUniqueTags(allPosts)
const uniqueCategories = getUniqueCategories(allPosts)
return paginate(allPostsByDate, { pageSize: 20, props: { uniqueTags, uniqueCategories } })
return paginate(allPostsByDate, { pageSize: 50, props: { uniqueTags, uniqueCategories } })
}) satisfies GetStaticPaths
interface Props {

View File

@ -20,7 +20,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
category === '未分类' ? !post.data.category : post.data.category === category
)
return paginate(filterPosts, {
pageSize: 20,
pageSize: 50,
params: { category }
})
})

View File

@ -18,7 +18,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
return uniqueTags.flatMap((tag) => {
const filterPosts = allPostsByDate.filter((post) => post.data.tags.includes(tag))
return paginate(filterPosts, {
pageSize: 20,
pageSize: 50,
params: { tag }
})
})