mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
[fix] category 文章数目与标签数目不对的问题,优化分页
This commit is contained in:
@@ -43,7 +43,7 @@ export async function getStaticProps({ params: { category } }) {
|
||||
if (BLOG.POST_LIST_STYLE === 'scroll') {
|
||||
// 滚动列表 给前端返回所有数据
|
||||
} else if (BLOG.POST_LIST_STYLE === 'page') {
|
||||
props.posts = props.posts?.slice(0, BLOG.POSTS_PER_PAGE - 1)
|
||||
props.posts = props.posts?.slice(0, BLOG.POSTS_PER_PAGE)
|
||||
}
|
||||
|
||||
delete props.allPages
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function getStaticProps({ params: { category, page } }) {
|
||||
// 处理文章页数
|
||||
props.postCount = props.posts.length
|
||||
// 处理分页
|
||||
props.posts = props.posts.slice(BLOG.POSTS_PER_PAGE * (page - 1), BLOG.POSTS_PER_PAGE * page - 1)
|
||||
props.posts = props.posts.slice(BLOG.POSTS_PER_PAGE * (page - 1), BLOG.POSTS_PER_PAGE * page)
|
||||
|
||||
delete props.allPages
|
||||
props.page = page
|
||||
|
||||
Reference in New Issue
Block a user