From ab2dc0271911be869fa4e3ec3fc6ab44ac8b3baf Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 12 Jul 2023 13:50:14 +0800 Subject: [PATCH] heo-theme --- themes/heo/components/BlogPostCard.js | 10 +++---- themes/heo/components/BlogPostCardInfo.js | 2 +- themes/heo/components/BlogPostListPage.js | 2 +- themes/heo/components/CategoryBar.js | 2 +- themes/heo/components/Header.js | 35 ++++++----------------- themes/heo/components/Hero.js | 15 +++++----- themes/heo/components/Logo.js | 4 +-- themes/heo/index.js | 2 +- 8 files changed, 28 insertions(+), 44 deletions(-) diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index e1e8edde..c9d4497a 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -23,21 +23,21 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { // data-aos-anchor-placement="top-bottom" id='blog-post-card' key={post.id} - className={`w-full justify-between flex flex-col-reverse lg:h-96 ${CONFIG.POST_LIST_IMG_CROSSOVER && index % 2 === 1 ? '' : ''} + className={`w-full justify-between flex flex-col lg:h-96 ${CONFIG.POST_LIST_IMG_CROSSOVER && index % 2 === 1 ? '' : ''} overflow-hidden border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray`}> - {/* 文字内容 */} - - {/* 图片封面 */} {showPageCover && ( -
+
)} + {/* 文字区块 */} + +
diff --git a/themes/heo/components/BlogPostCardInfo.js b/themes/heo/components/BlogPostCardInfo.js index 4b7feee6..54668297 100644 --- a/themes/heo/components/BlogPostCardInfo.js +++ b/themes/heo/components/BlogPostCardInfo.js @@ -10,7 +10,7 @@ import BLOG from '@/blog.config' * @returns */ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary }) => { - return
+ return
{/* 标题 */} { return (
{/* 文章列表 */} -
+
{posts?.map(post => ( ))} diff --git a/themes/heo/components/CategoryBar.js b/themes/heo/components/CategoryBar.js index 53e3af73..8820fe6d 100644 --- a/themes/heo/components/CategoryBar.js +++ b/themes/heo/components/CategoryBar.js @@ -5,5 +5,5 @@ * @returns */ export default function CategoryBar(props) { - return
+ return
} diff --git a/themes/heo/components/Header.js b/themes/heo/components/Header.js index 052815ae..4056da31 100644 --- a/themes/heo/components/Header.js +++ b/themes/heo/components/Header.js @@ -1,20 +1,14 @@ -import { useCallback, useEffect, useRef, useState } from 'react' +import { useCallback, useEffect, useState } from 'react' import Logo from './Logo' -import SearchDrawer from './SearchDrawer' import { MenuListTop } from './MenuListTop' import throttle from 'lodash.throttle' -import SideBar from './SideBar' -import SideBarDrawer from './SideBarDrawer' - /** * 顶部导航 * @param {*} param0 * @returns */ const Header = props => { - const searchDrawer = useRef() - const [isOpen, changeShow] = useState(false) const [headerBgShow, setHeaderBgShow] = useState(false) @@ -22,10 +16,6 @@ const Header = props => { changeShow(!isOpen) } - const toggleSideBarClose = () => { - changeShow(false) - } - // 监听滚动 useEffect(() => { scrollTrigger() @@ -38,8 +28,8 @@ const Header = props => { const throttleMs = 200 /** - * 根据滚动条,切换导航栏样式 - */ + * 根据滚动条,切换导航栏样式 + */ const scrollTrigger = useCallback(throttle(() => { const scrollS = window.scrollY const header = document.querySelector('#header') @@ -52,12 +42,10 @@ const Header = props => { } }, throttleMs)) - return ( - - {/* 折叠侧边栏 */} - - - -
) + + ) } export default Header diff --git a/themes/heo/components/Hero.js b/themes/heo/components/Hero.js index d14d6955..9c8b4dcf 100644 --- a/themes/heo/components/Hero.js +++ b/themes/heo/components/Hero.js @@ -6,23 +6,24 @@ */ const Hero = props => { return ( -
+ <> - +
- +
-
-
+
+
-
+
+
-
+ ) } diff --git a/themes/heo/components/Logo.js b/themes/heo/components/Logo.js index 71c264f4..5163a566 100644 --- a/themes/heo/components/Logo.js +++ b/themes/heo/components/Logo.js @@ -6,10 +6,10 @@ const Logo = props => { const { siteInfo } = props return ( -
+
{/* eslint-disable-next-line @next/next/no-img-element */} {BLOG.AUTHOR} -
{siteInfo?.title || BLOG.TITLE}
+
{siteInfo?.title || BLOG.TITLE}
) diff --git a/themes/heo/index.js b/themes/heo/index.js index d0087aa9..47025da9 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -71,7 +71,7 @@ const LayoutBase = props => { {/* 主区块 */} -
+