diff --git a/lib/lang/en-US.js b/lib/lang/en-US.js index f60b375ae13..0a508878f4c 100644 --- a/lib/lang/en-US.js +++ b/lib/lang/en-US.js @@ -61,7 +61,8 @@ export default { START_READING: 'Start Reading', MINUTE: 'min', WORD_COUNT: 'Words', - READ_TIME: 'Read Time' + READ_TIME: 'Read Time', + NEXT_POST: '下一篇' }, PAGINATION: { PREV: 'Prev', diff --git a/lib/lang/zh-CN.js b/lib/lang/zh-CN.js index 4dd1962e764..9969452da08 100644 --- a/lib/lang/zh-CN.js +++ b/lib/lang/zh-CN.js @@ -62,7 +62,8 @@ export default { START_READING: '开始阅读', MINUTE: '分钟', WORD_COUNT: '字数', - READ_TIME: '阅读时长' + READ_TIME: '阅读时长', + NEXT_POST:'下一篇' }, PAGINATION: { PREV: '上页', diff --git a/themes/example/components/BlogListPage.js b/themes/example/components/BlogListPage.js index f9ae29a42dd..b8a1e573c61 100644 --- a/themes/example/components/BlogListPage.js +++ b/themes/example/components/BlogListPage.js @@ -24,6 +24,7 @@ export const BlogListPage = props => { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') const showPageCover = siteConfig('EXAMPLE_POST_LIST_COVER', null, CONFIG) diff --git a/themes/game/components/PaginationSimple.js b/themes/game/components/PaginationSimple.js index 3f5a2760b01..6df710f5513 100644 --- a/themes/game/components/PaginationSimple.js +++ b/themes/game/components/PaginationSimple.js @@ -17,6 +17,7 @@ const PaginationSimple = ({ page, showNext }) => { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') return (
diff --git a/themes/heo/components/Header.js b/themes/heo/components/Header.js index 3e1fd81433d..bebe333ba9f 100644 --- a/themes/heo/components/Header.js +++ b/themes/heo/components/Header.js @@ -140,7 +140,7 @@ const Header = props => { {/* 顶部导航菜单栏 */}
diff --git a/themes/heo/index.js b/themes/heo/index.js index 26c1aeda0a8..33f88f270de 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -291,18 +291,19 @@ const LayoutSlug = props => { {!lock && (
{/* 文章主体 */} -
+
{/* Notion文章主体 */} -
+
{post && }
+ {/* 上一篇\下一篇文章 */} + + {/* 分享 */} {post?.type === 'Post' && ( @@ -315,9 +316,6 @@ const LayoutSlug = props => { )}
- {/* 上一篇\下一篇文章 */} - - {/* 评论区 */} {fullWidth ? null : (
diff --git a/themes/hexo/components/PaginationNumber.js b/themes/hexo/components/PaginationNumber.js index e99a0c5df5c..57d755dd59f 100644 --- a/themes/hexo/components/PaginationNumber.js +++ b/themes/hexo/components/PaginationNumber.js @@ -16,6 +16,7 @@ const PaginationNumber = ({ page, totalPage }) => { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') const pages = generatePages(pagePrefix, page, currentPage, totalPage) return ( diff --git a/themes/movie/components/PaginationNumber.js b/themes/movie/components/PaginationNumber.js index effc1835549..64323b9cc03 100644 --- a/themes/movie/components/PaginationNumber.js +++ b/themes/movie/components/PaginationNumber.js @@ -22,6 +22,7 @@ const PaginationNumber = ({ page, totalPage }) => { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') const pages = generatePages(pagePrefix, page, currentPage, totalPage) if (pages?.length <= 1) { return <> @@ -46,7 +47,7 @@ const PaginationNumber = ({ page, totalPage }) => { return ( <> {/* pc端分页按钮 */} -
+
{/* 上一页 */} { : `${pagePrefix}/page/${currentPage - 1}`, query: router.query.s ? { s: router.query.s } : {} }} - rel="prev" - className={`${currentPage === 1 ? 'invisible' : 'block'}`} - > -
- -
+ rel='prev' + className={`${currentPage === 1 ? 'invisible' : 'block'}`}> +
+ +
{locale.PAGINATION.PREV}
{/* 分页 */} -
+
{pages} {/* 跳转页码 */} -
+
+ className='w-0 group-hover:w-20 group-hover:px-3 transition-all duration-200 bg-gray-100 border-none outline-none h-full rounded-lg' + onInput={handleInputChange}>
+ className='cursor-pointer hover:bg-indigo-600 dark:bg-[#1e1e1e] dark:hover:bg-yellow-600 hover:text-white px-4 py-2 group-hover:px-2 group-hover:mx-1 group-hover:rounded bg-white'>
@@ -93,12 +91,11 @@ const PaginationNumber = ({ page, totalPage }) => { pathname: `${pagePrefix}/page/${currentPage + 1}`, query: router.query.s ? { s: router.query.s } : {} }} - rel="next" - className={`${+showNext ? 'block' : 'invisible'} `} - > -
- -
+ rel='next' + className={`${+showNext ? 'block' : 'invisible'} `}> +
+ +
{locale.PAGINATION.NEXT}
@@ -107,7 +104,7 @@ const PaginationNumber = ({ page, totalPage }) => { {/* 移动端分页 */} -
+
{/* 上一页 */} { : `${pagePrefix}/page/${currentPage - 1}`, query: router.query.s ? { s: router.query.s } : {} }} - rel="prev" - className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`} - > + rel='prev' + className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.PREV} - {showPrev && showNext &&
} + {showPrev && showNext &&
} {/* 下一页 */} { pathname: `${pagePrefix}/page/${currentPage + 1}`, query: router.query.s ? { s: router.query.s } : {} }} - rel="next" - className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`} - > + rel='next' + className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.NEXT}
@@ -163,8 +158,7 @@ function getPageElement(page, currentPage, pagePrefix) { ? 'bg-indigo-600 dark:bg-yellow-600 text-white ' : 'dark:bg-[#1e1e1e] bg-white') + ' hover:border-indigo-600 dark:hover:bg-yellow-600 dark:border-gray-600 px-4 border py-2 rounded-lg drop-shadow-sm duration-200 transition-colors' - } - > + }> {page} ) @@ -197,7 +191,7 @@ function generatePages(pagePrefix, page, currentPage, totalPage) { } if (startPage > 2) { pages.push( -
+
...{' '}
) diff --git a/themes/next/components/ArticleDetail.js b/themes/next/components/ArticleDetail.js index bdd677ef710..f461b5f79cd 100644 --- a/themes/next/components/ArticleDetail.js +++ b/themes/next/components/ArticleDetail.js @@ -1,20 +1,20 @@ -import BlogAround from './BlogAround' import Comment from '@/components/Comment' -import RecommendPosts from './RecommendPosts' +import LazyImage from '@/components/LazyImage' +import NotionIcon from '@/components/NotionIcon' +import NotionPage from '@/components/NotionPage' import ShareBar from '@/components/ShareBar' -import TagItem from './TagItem' +import WWAds from '@/components/WWAds' +import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' +import { formatDateFmt } from '@/lib/utils/formatDate' import Link from 'next/link' import { useRouter } from 'next/router' +import CONFIG from '../config' import ArticleCopyright from './ArticleCopyright' +import BlogAround from './BlogAround' +import RecommendPosts from './RecommendPosts' +import TagItem from './TagItem' import WordCount from './WordCount' -import NotionPage from '@/components/NotionPage' -import CONFIG from '../config' -import NotionIcon from '@/components/NotionIcon' -import LazyImage from '@/components/LazyImage' -import { formatDateFmt } from '@/lib/utils/formatDate' -import { siteConfig } from '@/lib/config' -import WWAds from '@/components/WWAds' /** * @@ -35,105 +35,135 @@ export default function ArticleDetail(props) { } return ( -
-
- - {showArticleInfo &&
- {/* 头图 */} - {siteConfig('NEXT_POST_HEADER_IMAGE_VISIBLE', null, CONFIG) && post?.type && !post?.type !== 'Page' && post?.pageCover && ( -
- -
- )} - - {/* title */} -
- {siteConfig('POST_TITLE_ICON') && }{post.title} -
- - {/* meta */} -
-
- {post?.type !== 'Page' && (<> - -
- {post?.publishDay} -
- - | {post.lastEditedDay} - -
- - -
- - )} -
- - -
- -
} - - {/* Notion内容主体 */} -
- - {post && ()} - -
- - {showArticleInfo && <> - - {/* 分享 */} - - - {/* 版权声明 */} - {post?.type === 'Post' && } - - {/* 推荐文章 */} - {post?.type === 'Post' && } - -
- {/* 分类 */} - {post.category && <> - - } - - {/* 标签列表 */} - {post?.type === 'Post' && ( - <> - {post.tagItems && ( -
-
- {locale.COMMON.TAGS}:  -
- {post.tagItems.map(tag => ( - - ))} -
- )} - - )} -
- {post?.type === 'Post' && } - } - - {/* 评论互动 */} -
- +
+
+ {showArticleInfo && ( +
+ {/* 头图 */} + {siteConfig('NEXT_POST_HEADER_IMAGE_VISIBLE', null, CONFIG) && + post?.type && + !post?.type !== 'Page' && + post?.pageCover && ( +
+
+ )} + + {/* title */} +
+ {siteConfig('POST_TITLE_ICON') && ( + + )} + {post.title}
+ {/* meta */} +
+
+ {post?.type !== 'Page' && ( + <> + +
+ {' '} + {post?.publishDay} +
+ + + {' '} + | + {post.lastEditedDay}{' '} + + +
+ + +
+ + )} +
+ + +
+
+ )} + + {/* Notion内容主体 */} +
+ + {post && } + +
+ + {showArticleInfo && ( + <> + {/* 分享 */} + + + {/* 版权声明 */} + {post?.type === 'Post' && ( + + )} + + {/* 推荐文章 */} + {post?.type === 'Post' && ( + + )} + +
+ {/* 分类 */} + {post.category && ( + <> + + + )} + + {/* 标签列表 */} + {post?.type === 'Post' && ( + <> + {post.tagItems && ( +
+
+ {locale.COMMON.TAGS}:  +
+ {post.tagItems.map(tag => ( + + ))} +
+ )} + + )} +
+ {post?.type === 'Post' && } + + )} + + {/* 评论互动 */} +
+
+
+
) } diff --git a/themes/next/components/PaginationNumber.js b/themes/next/components/PaginationNumber.js index af72c797da3..02c61693fb0 100644 --- a/themes/next/components/PaginationNumber.js +++ b/themes/next/components/PaginationNumber.js @@ -16,6 +16,8 @@ const PaginationNumber = ({ page, totalPage }) => { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') + const pages = generatePages(pagePrefix, page, currentPage, totalPage) return ( @@ -67,22 +69,14 @@ const PaginationNumber = ({ page, totalPage }) => { ) } -function getPageElement(pagePrefix, page, currentPage) { - return ( - - {page} - - ) -} +/** + * 生成分页按钮组 + * @param {*} pagePrefix + * @param {*} page + * @param {*} currentPage + * @param {*} totalPage + * @returns + */ function generatePages(pagePrefix, page, currentPage, totalPage) { const pages = [] const groupCount = 7 // 最多显示页签数 @@ -126,4 +120,28 @@ function generatePages(pagePrefix, page, currentPage, totalPage) { } return pages } +/** + * 生成分页按钮对象 + * @param {*} pagePrefix + * @param {*} page + * @param {*} currentPage + * @returns + */ +function getPageElement(pagePrefix, page, currentPage) { + return ( + + {page} + + ) +} + export default PaginationNumber diff --git a/themes/next/style.js b/themes/next/style.js index daf6af46ab0..41746f9affe 100644 --- a/themes/next/style.js +++ b/themes/next/style.js @@ -5,35 +5,31 @@ * @returns */ const Style = () => { - return + // 菜单下划线动画 + #theme-next .menu-link { + text-decoration: none; + background-image: linear-gradient(#4e80ee, #4e80ee); + background-repeat: no-repeat; + background-position: bottom center; + background-size: 0 2px; + transition: background-size 100ms ease-in-out; + } + #theme-next .menu-link:hover { + background-size: 100% 2px; + color: #4e80ee; + } + `} + ) } export { Style } diff --git a/themes/nobelium/components/BlogListPage.js b/themes/nobelium/components/BlogListPage.js index 0c313ba4fc1..6998c522e74 100644 --- a/themes/nobelium/components/BlogListPage.js +++ b/themes/nobelium/components/BlogListPage.js @@ -19,6 +19,7 @@ export const BlogListPage = props => { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') return (
diff --git a/themes/plog/components/BlogListPage.js b/themes/plog/components/BlogListPage.js index 68790295974..9224c16b90c 100644 --- a/themes/plog/components/BlogListPage.js +++ b/themes/plog/components/BlogListPage.js @@ -20,6 +20,7 @@ export const BlogListPage = props => { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') const blogPostRefs = useRef([]) diff --git a/themes/simple/components/BlogListPage.js b/themes/simple/components/BlogListPage.js index 0345185bf0b..1219aac77a6 100644 --- a/themes/simple/components/BlogListPage.js +++ b/themes/simple/components/BlogListPage.js @@ -32,6 +32,7 @@ export default function BlogListPage(props) { .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') + .replace('.html', '') return (