From 7bd83370191b9dc84dda694998672d3ee15cb5a3 Mon Sep 17 00:00:00 2001 From: emengweb Date: Tue, 25 Apr 2023 11:53:44 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9hexo=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E4=BD=8D=E7=BD=AE=E5=92=8C=E9=97=B4=E9=9A=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/LayoutBase.js | 2 +- themes/hexo/components/Announcement.js | 4 ++-- themes/hexo/components/ArticleRecommend.js | 17 +++++++++----- themes/hexo/components/BlogPostCard.js | 2 +- themes/hexo/components/BlogPostCardInfo.js | 24 +++++++++++--------- themes/hexo/components/Card.js | 2 +- themes/hexo/components/Catalog.js | 4 ++-- themes/hexo/components/HeaderArticle.js | 26 ++++++++++++---------- themes/hexo/components/LatestPostsGroup.js | 6 ++--- themes/hexo/components/Progress.js | 4 ++-- themes/hexo/components/SideBarDrawer.js | 2 +- themes/hexo/components/TocDrawer.js | 2 +- 12 files changed, 52 insertions(+), 43 deletions(-) diff --git a/themes/hexo/LayoutBase.js b/themes/hexo/LayoutBase.js index 27c8e1a9..1f9f458b 100644 --- a/themes/hexo/LayoutBase.js +++ b/themes/hexo/LayoutBase.js @@ -33,7 +33,7 @@ const FacebookPage = dynamic( * @constructor */ const LayoutBase = props => { - const { children, headerSlot, floatSlot, meta, siteInfo } = props + const { children, headerSlot, floatSlot, meta, siteInfo, showTag } = props const [showFloatButton, switchShow] = useState(false) // const [percent, changePercent] = useState(0) // 页面阅读百分比 const rightAreaSlot = ( diff --git a/themes/hexo/components/Announcement.js b/themes/hexo/components/Announcement.js index 02270982..695c26a4 100644 --- a/themes/hexo/components/Announcement.js +++ b/themes/hexo/components/Announcement.js @@ -7,10 +7,10 @@ const Announcement = ({ post, className }) => { const { locale } = useGlobal() if (post?.blockMap) { return
-
+
{locale.COMMON.ANNOUNCEMENT}
{post && (
- +
)}
diff --git a/themes/hexo/components/ArticleRecommend.js b/themes/hexo/components/ArticleRecommend.js index d2354cd3..446dfb9c 100644 --- a/themes/hexo/components/ArticleRecommend.js +++ b/themes/hexo/components/ArticleRecommend.js @@ -2,6 +2,7 @@ import Link from 'next/link' import CONFIG_HEXO from '../config_hexo' import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' +import TagItemMini from './TagItemMini' /** * 关联推荐文章 @@ -20,7 +21,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) { } return ( -
+
@@ -46,12 +47,16 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) { style={{ backgroundImage: headerImage }} >
-
-
- - {post.date?.start_date} +
+
{post.title}
+
+
+ {' '} + {post.tagItems.map(tag => ( +
{selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
+ ))} +
-
{post.title}
diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index 56a69368..4725350b 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -36,7 +36,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { {showPageCover && (
-
+
)} diff --git a/themes/hexo/components/BlogPostCardInfo.js b/themes/hexo/components/BlogPostCardInfo.js index 88ceaeed..b44dfef3 100644 --- a/themes/hexo/components/BlogPostCardInfo.js +++ b/themes/hexo/components/BlogPostCardInfo.js @@ -17,24 +17,24 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary href={`${BLOG.SUB_PATH}/${post.slug}`} passHref className={`replace cursor-pointer hover:underline text-2xl ${showPreview ? 'text-center' : '' - } leading-tight text-gray-600 dark:text-gray-100 hover:text-indigo-700 dark:hover:text-indigo-400`}> + } leading-tight font-normal text-gray-600 dark:text-gray-100 hover:text-indigo-700 dark:hover:text-indigo-400`}> {post.title} - {/* 日期 */} + {/* 分类 */}
+ className="cursor-pointer font-light text-sm hover:underline hover:text-indigo-700 dark:hover:text-indigo-400 transform"> - - {post.date?.start_date || post.lastEditedTime} + + {post.category}
@@ -64,17 +64,19 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary
- {/* 分类标签 */} + {/* 日期标签 */}
+ {/* 日期 */} + className="font-light hover:underline cursor-pointer text-sm leading-4 mr-3"> - - {post.category} + + {post.date?.start_date || post.lastEditedTime} +
{' '} diff --git a/themes/hexo/components/Card.js b/themes/hexo/components/Card.js index c166ffc1..c2db0e49 100644 --- a/themes/hexo/components/Card.js +++ b/themes/hexo/components/Card.js @@ -1,7 +1,7 @@ const Card = ({ children, headerSlot, className }) => { return
<>{headerSlot} -
+
{children}
diff --git a/themes/hexo/components/Catalog.js b/themes/hexo/components/Catalog.js index 1e7d5b40..980be47b 100644 --- a/themes/hexo/components/Catalog.js +++ b/themes/hexo/components/Catalog.js @@ -61,7 +61,7 @@ const Catalog = ({ toc }) => { return <> } - return
+ return
{locale.COMMON.TABLE_OF_CONTENTS}
@@ -79,7 +79,7 @@ const Catalog = ({ toc }) => { notion-table-of-contents-item-indent-level-${tocItem.indentLevel} `} > {tocItem.text} diff --git a/themes/hexo/components/HeaderArticle.js b/themes/hexo/components/HeaderArticle.js index 8c0f2a0e..c4b33a6d 100644 --- a/themes/hexo/components/HeaderArticle.js +++ b/themes/hexo/components/HeaderArticle.js @@ -3,6 +3,7 @@ import TagItemMini from './TagItemMini' import { useGlobal } from '@/lib/global' import formatDate from '@/lib/formatDate' import BLOG from '@/blog.config' +import NotionIcon from '@/components/NotionIcon' export default function HeaderArticle({ post, siteInfo }) { const { locale } = useGlobal() @@ -30,24 +31,25 @@ export default function HeaderArticle({ post, siteInfo }) { data-aos-anchor-placement="top-bottom" className="bg-black bg-opacity-70 absolute top-0 w-full h-96 py-10 flex justify-center items-center "> -
- {/* 文章Title */} -
- {post.title} -
- -
-
+
+
{post.category && <> -
- +
{post.category}
}
-
+ + {/* 文章Title */} +
+ {post.title} +
+ +
+ +
{post?.type !== 'Page' && ( <> }
-
+
{post.tagItems && (
{post.tagItems.map(tag => ( diff --git a/themes/hexo/components/LatestPostsGroup.js b/themes/hexo/components/LatestPostsGroup.js index e5d02a71..0ba78886 100644 --- a/themes/hexo/components/LatestPostsGroup.js +++ b/themes/hexo/components/LatestPostsGroup.js @@ -37,9 +37,9 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => { title={post.title} href={`${BLOG.SUB_PATH}/${post.slug}`} passHref - className={'my-2 flex'}> + className={'my-3 flex'}> -
+
{/* { quality={10} alt={post.title} /> */} {/* eslint-disable-next-line @next/next/no-img-element */} - +
{ }, []) return ( -
+
{showPercent && ( diff --git a/themes/hexo/components/SideBarDrawer.js b/themes/hexo/components/SideBarDrawer.js index 629889b9..07c122fd 100644 --- a/themes/hexo/components/SideBarDrawer.js +++ b/themes/hexo/components/SideBarDrawer.js @@ -39,7 +39,7 @@ const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => { return