From 9bacb4672fd4f50430e39c649eed11013d362936 Mon Sep 17 00:00:00 2001 From: tangly Date: Sat, 19 Nov 2022 21:31:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/example/components/BlogListPage.js | 2 +- themes/fukasawa/components/PaginationSimple.js | 2 +- themes/hexo/components/PaginationNumber.js | 5 +++-- themes/medium/components/PaginationSimple.js | 2 +- themes/next/components/PaginationNumber.js | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/themes/example/components/BlogListPage.js b/themes/example/components/BlogListPage.js index 2feab00f..c98ccd54 100644 --- a/themes/example/components/BlogListPage.js +++ b/themes/example/components/BlogListPage.js @@ -50,7 +50,7 @@ export const BlogListPage = props => {
- + {locale.PAGINATION.PREV} diff --git a/themes/fukasawa/components/PaginationSimple.js b/themes/fukasawa/components/PaginationSimple.js index 71ba8b8f..3c737b6d 100644 --- a/themes/fukasawa/components/PaginationSimple.js +++ b/themes/fukasawa/components/PaginationSimple.js @@ -21,7 +21,7 @@ const PaginationSimple = ({ page, showNext }) => { href={{ pathname: currentPage === 2 - ? `${pagePrefix}` + ? `${pagePrefix}/` : `${pagePrefix}/page/${currentPage - 1}`, query: router.query.s ? { s: router.query.s } : {} }} diff --git a/themes/hexo/components/PaginationNumber.js b/themes/hexo/components/PaginationNumber.js index 96207d43..811db406 100644 --- a/themes/hexo/components/PaginationNumber.js +++ b/themes/hexo/components/PaginationNumber.js @@ -13,6 +13,7 @@ const PaginationNumber = ({ page, totalPage }) => { const currentPage = +page const showNext = page < totalPage const pagePrefix = router.asPath.replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '') + console.log('哈哈', pagePrefix, page, currentPage, totalPage) const pages = generatePages(pagePrefix, page, currentPage, totalPage) return ( @@ -21,7 +22,7 @@ const PaginationNumber = ({ page, totalPage }) => { { function getPageElement(page, currentPage, pagePrefix) { return ( - + { href={{ pathname: currentPage === 2 - ? `${pagePrefix}` + ? `${pagePrefix}/` : `${pagePrefix}/page/${currentPage - 1}`, query: router.query.s ? { s: router.query.s } : {} }} diff --git a/themes/next/components/PaginationNumber.js b/themes/next/components/PaginationNumber.js index 75f048cf..f786c853 100644 --- a/themes/next/components/PaginationNumber.js +++ b/themes/next/components/PaginationNumber.js @@ -22,7 +22,7 @@ const PaginationNumber = ({ page, totalPage }) => { href={{ pathname: currentPage - 1 === 1 - ? `${pagePrefix}}` + ? `${pagePrefix}/` : `${pagePrefix}/page/${currentPage - 1}`, query: router.query.s ? { s: router.query.s } : {} }} @@ -63,7 +63,7 @@ function getPageElement(pagePrefix, page, currentPage) { console.log(pagePrefix, page, currentPage) return ( - +