mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-23 02:31:33 +08:00
feat: update pagesize
This commit is contained in:
@ -10,6 +10,11 @@
|
|||||||
"astro": "astro",
|
"astro": "astro",
|
||||||
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,svelte,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,svelte,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": {
|
"dependencies": {
|
||||||
"@astrojs/check": "^0.5.6",
|
"@astrojs/check": "^0.5.6",
|
||||||
"@astrojs/mdx": "^2.1.1",
|
"@astrojs/mdx": "^2.1.1",
|
||||||
|
@ -15,7 +15,7 @@ export const getStaticPaths = (async ({ paginate }) => {
|
|||||||
const allPostsByDate = sortMDByDate(allPosts)
|
const allPostsByDate = sortMDByDate(allPosts)
|
||||||
const uniqueTags = getUniqueTags(allPosts)
|
const uniqueTags = getUniqueTags(allPosts)
|
||||||
const uniqueCategories = getUniqueCategories(allPosts)
|
const uniqueCategories = getUniqueCategories(allPosts)
|
||||||
return paginate(allPostsByDate, { pageSize: 20, props: { uniqueTags, uniqueCategories } })
|
return paginate(allPostsByDate, { pageSize: 50, props: { uniqueTags, uniqueCategories } })
|
||||||
}) satisfies GetStaticPaths
|
}) satisfies GetStaticPaths
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -20,7 +20,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
|
|||||||
category === '未分类' ? !post.data.category : post.data.category === category
|
category === '未分类' ? !post.data.category : post.data.category === category
|
||||||
)
|
)
|
||||||
return paginate(filterPosts, {
|
return paginate(filterPosts, {
|
||||||
pageSize: 20,
|
pageSize: 50,
|
||||||
params: { category }
|
params: { category }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -18,7 +18,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
|
|||||||
return uniqueTags.flatMap((tag) => {
|
return uniqueTags.flatMap((tag) => {
|
||||||
const filterPosts = allPostsByDate.filter((post) => post.data.tags.includes(tag))
|
const filterPosts = allPostsByDate.filter((post) => post.data.tags.includes(tag))
|
||||||
return paginate(filterPosts, {
|
return paginate(filterPosts, {
|
||||||
pageSize: 20,
|
pageSize: 50,
|
||||||
params: { tag }
|
params: { tag }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user