mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-22 02:01:32 +08:00
feat: bigger page size
This commit is contained in:
@ -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: 10, props: { uniqueTags, uniqueCategories } })
|
||||
return paginate(allPostsByDate, { pageSize: 20, props: { uniqueTags, uniqueCategories } })
|
||||
}) satisfies GetStaticPaths
|
||||
|
||||
interface Props {
|
||||
@ -74,7 +74,7 @@ const paginationProps = {
|
||||
<section aria-label='Blog posts list'>
|
||||
<ul class='flex flex-col gap-y-4 text-start'>
|
||||
{page.data.map((p) => (
|
||||
<PostPreview post={p} />
|
||||
<PostPreview post={p} />
|
||||
))}
|
||||
</ul>
|
||||
<Pagination {...paginationProps} />
|
||||
|
@ -20,7 +20,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
|
||||
category === '未分类' ? !post.data.category : post.data.category === category
|
||||
)
|
||||
return paginate(filterPosts, {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
params: { category }
|
||||
})
|
||||
})
|
||||
|
@ -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: 10,
|
||||
pageSize: 20,
|
||||
params: { tag }
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user