分页预渲染,分页组件优化
This commit is contained in:
tangly1024
2022-01-05 16:59:19 +08:00
parent 8baaf673d3
commit a5cbfb9b08
2 changed files with 2 additions and 4 deletions

View File

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