From a5cbfb9b087f5a72a6e355efc3d549d09c4f1f6c Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 5 Jan 2022 16:59:19 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=88=86=E9=A1=B5=E9=A2=84=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=EF=BC=8C=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/PaginationNumber.js | 2 +- pages/page/[page].js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/PaginationNumber.js b/components/PaginationNumber.js index ea5114db..a42c5a06 100644 --- a/components/PaginationNumber.js +++ b/components/PaginationNumber.js @@ -48,7 +48,7 @@ const PaginationNumber = ({ page, showNext, totalPage }) => { } function getPageElement (page, currentPage) { - return + return {page} diff --git a/pages/page/[page].js b/pages/page/[page].js index e7a86cb8..a7dc5e70 100644 --- a/pages/page/[page].js +++ b/pages/page/[page].js @@ -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 } }