修复page=1的path异常

This commit is contained in:
tangly1024
2021-10-18 14:02:23 +08:00
parent cc289bb545
commit 880505b9d1

View File

@@ -26,9 +26,8 @@ export async function getStaticPaths () {
const totalPosts = posts.length
const totalPages = Math.ceil(totalPosts / BLOG.postsPerPage)
return {
// remove first page, we 're not gonna handle that.
paths: Array.from({ length: totalPages - 1 }, (_, i) => ({
params: { page: '' + (i + 2) }
params: { page: '' + (i + 1) }
})),
fallback: true
}