From 89634479b50f0f7ae8048a50a8d55a961e072e7b Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 13 Jul 2023 22:13:47 +0800 Subject: [PATCH] theme-heo --- themes/heo/components/BlogPostCard.js | 52 ++++---- themes/heo/components/BlogPostListPage.js | 2 +- themes/heo/components/CategoryBar.js | 18 +-- themes/heo/components/Header.js | 8 +- themes/heo/components/Hero.js | 141 ++++++++++++++-------- themes/heo/components/SideRight.js | 2 +- themes/heo/index.js | 8 +- themes/heo/style.js | 8 ++ 8 files changed, 142 insertions(+), 97 deletions(-) diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index 142a54fc..cc7598a9 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -12,11 +12,11 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { const showPageCover = CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail && !showPreview return (
-
+
{/* 图片封面 */} {showPageCover && ( -
+
@@ -24,11 +24,10 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { )} {/* 文字区块 */} - {/* */} -
+
{/* 分类 */} - {post?.category &&
+ {post?.category && - {/* 摘要 */} - {(!showPreview || showSummary) && !post.results && ( -

- {post.summary} -

- )} + {/* 摘要 */} + {(!showPreview || showSummary) && !post.results && ( +

+ {post.summary} +

+ )} - {/* 搜索结果 */} - {post.results && ( -

- {post.results.map(r => ( - {r} - ))} -

- )} + {/* 搜索结果 */} + {post.results && ( +

+ {post.results.map(r => ( + {r} + ))} +

+ )} -
-
- {' '} - {post.tagItems?.map(tag => ( - - ))} -
+
+
+ {' '} + {post.tagItems?.map(tag => ( + + ))}
diff --git a/themes/heo/components/BlogPostListPage.js b/themes/heo/components/BlogPostListPage.js index c2ec5869..8c9e1fd6 100644 --- a/themes/heo/components/BlogPostListPage.js +++ b/themes/heo/components/BlogPostListPage.js @@ -20,7 +20,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => { return (
{/* 文章列表 */} -
+
{posts?.map(post => ( ))} diff --git a/themes/heo/components/CategoryBar.js b/themes/heo/components/CategoryBar.js index cb8d9399..298c9128 100644 --- a/themes/heo/components/CategoryBar.js +++ b/themes/heo/components/CategoryBar.js @@ -11,22 +11,16 @@ export default function CategoryBar(props) { const { categoryOptions } = props const { locale } = useGlobal() - return
+ return
-
+
- {categoryOptions?.map((c, index) => { - return ( -
- -
- ) - })} + {categoryOptions?.map((c, index) => )}
- + {locale.COMMON.MORE}
@@ -41,7 +35,7 @@ export default function CategoryBar(props) { const MenuItem = ({ href, name }) => { const router = useRouter() const selected = router.pathname === href - return
+ return
{name}
} diff --git a/themes/heo/components/Header.js b/themes/heo/components/Header.js index 81c3ee0e..10c1b335 100644 --- a/themes/heo/components/Header.js +++ b/themes/heo/components/Header.js @@ -28,8 +28,8 @@ const Header = props => { const throttleMs = 200 /** - * 根据滚动条,切换导航栏样式 - */ + * 根据滚动条,切换导航栏样式 + */ const scrollTrigger = useCallback(throttle(() => { const scrollS = window.scrollY const header = document.querySelector('#header') @@ -44,8 +44,8 @@ const Header = props => { return (<> {/* 头条 */} -