diff --git a/components/BlogPostArchive.js b/components/BlogPostArchive.js index 646c9c29..be661f9b 100644 --- a/components/BlogPostArchive.js +++ b/components/BlogPostArchive.js @@ -13,19 +13,17 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => { if (!posts || posts.length === 0) { return <> } else { - return
-
{archiveTitle}
- {/* 文章列表 */} + return
+
{archiveTitle}
-
} } diff --git a/components/MenuButtonGroup.js b/components/MenuButtonGroup.js index 857b2779..34021131 100644 --- a/components/MenuButtonGroup.js +++ b/components/MenuButtonGroup.js @@ -25,7 +25,7 @@ const MenuButtonGroup = ({ allowCollapse = false }) => {
{links.map(link => { if (link.show) { - const selected = router.asPath === link.to + const selected = router.pathname === link.to return diff --git a/pages/archive/index.js b/pages/archive/index.js index 6aae96e1..57e2bcb9 100644 --- a/pages/archive/index.js +++ b/pages/archive/index.js @@ -59,7 +59,7 @@ const Index = ({ allPosts, tags, categories }) => {
-
{locale.NAV.ARCHIVE}
+
{locale.NAV.ARCHIVE}
{Object.keys(archivePosts).map(archiveTitle => ( diff --git a/pages/article/[slug].js b/pages/article/[slug].js index 875f76ba..3e7a65dc 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -6,7 +6,6 @@ import Progress from '@/components/Progress' import TagItem from '@/components/TagItem' import formatDate from '@/lib/formatDate' import { Code, Collection, CollectionRow, Equation, NotionRenderer } from 'react-notion-x' -import RewardButton from '@/components/RewardButton' import ShareBar from '@/components/ShareBar' import Comment from '@/components/Comment' import BaseLayout from '@/layouts/BaseLayout' @@ -47,6 +46,7 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories const drawerRight = useRef(null) const url = BLOG.link + useRouter().asPath const { locale } = useGlobal() + const date = formatDate(post?.date?.start_date || post.createdTime, BLOG.lang) return @@ -56,7 +56,7 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories
{post.type && !post.type.includes('Page') && (<>
- 1) ? post.page_cover : BLOG.defaultImgCover} loading='lazy' objectFit='cover' layout='fill' alt={post.title} /> + 1) ? post.page_cover : BLOG.defaultImgCover} loading='eager' objectFit='cover' layout='fill' alt={post.title} />
)} @@ -71,12 +71,9 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories
{post.type[0] !== 'Page' && ( - +
- {formatDate( - post?.date?.start_date || post.createdTime, - BLOG.lang - )} + {date}
)}