From 826692f302456548f37f1b138eb7bac09909a5a4 Mon Sep 17 00:00:00 2001 From: tangly Date: Sun, 13 Nov 2022 11:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=20medium=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/medium/LayoutCategory.js | 8 +++++--- themes/medium/LayoutTag.js | 4 +++- themes/medium/components/PaginationSimple.js | 9 +++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/themes/medium/LayoutCategory.js b/themes/medium/LayoutCategory.js index 0cd835da..a3018144 100644 --- a/themes/medium/LayoutCategory.js +++ b/themes/medium/LayoutCategory.js @@ -1,11 +1,13 @@ import LayoutBase from './LayoutBase' import BlogPostListScroll from './components/BlogPostListScroll' +import BlogPostListPage from './components/BlogPostListPage' +import BLOG from '@/blog.config' export const LayoutCategory = props => { const { category } = props - const slotTop =
分类:
{category}
+ const slotTop =
分类:
{category}
return - - + {BLOG.POST_LIST_STYLE === 'page' ? : } + } diff --git a/themes/medium/LayoutTag.js b/themes/medium/LayoutTag.js index 0e6bd79b..dda44141 100644 --- a/themes/medium/LayoutTag.js +++ b/themes/medium/LayoutTag.js @@ -1,11 +1,13 @@ import LayoutBase from './LayoutBase' import BlogPostListScroll from './components/BlogPostListScroll' +import BLOG from '@/blog.config' +import BlogPostListPage from './components/BlogPostListPage' export const LayoutTag = (props) => { const { tag } = props const slotTop =
标签:
{tag}
return - + {BLOG.POST_LIST_STYLE === 'page' ? : } } diff --git a/themes/medium/components/PaginationSimple.js b/themes/medium/components/PaginationSimple.js index 080a899f..a8f685d8 100644 --- a/themes/medium/components/PaginationSimple.js +++ b/themes/medium/components/PaginationSimple.js @@ -1,4 +1,3 @@ -import BLOG from '@/blog.config' import Link from 'next/link' import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' @@ -15,14 +14,16 @@ const PaginationSimple = ({ page, totalPage }) => { const router = useRouter() const currentPage = +page const showNext = currentPage < totalPage + const pagePrefix = router.asPath.replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '') + return (
{