diff --git a/themes/heo/components/CategoryBar.js b/themes/heo/components/CategoryBar.js index ee0a7a0c629..eccd9685621 100644 --- a/themes/heo/components/CategoryBar.js +++ b/themes/heo/components/CategoryBar.js @@ -28,6 +28,7 @@ export default function CategoryBar(props) { setScrollRight(!scrollRight) } } + return
@@ -54,7 +55,8 @@ export default function CategoryBar(props) { */ const MenuItem = ({ href, name }) => { const router = useRouter() - const selected = router.pathname === href + const { category } = router.query + const selected = category === name return
{name}
diff --git a/themes/heo/components/Hero.js b/themes/heo/components/Hero.js index b92695610ea..14cad8b086f 100644 --- a/themes/heo/components/Hero.js +++ b/themes/heo/components/Hero.js @@ -17,18 +17,24 @@ import CONFIG from '../config' */ const Hero = props => { return ( -
+
+
+ {/* 左侧banner组 */} + -
- - {/* 左侧banner组 */} - - - {/* 右侧置顶文章组 */} - - -
-
+ {/* 右侧置顶文章组 */} + +
+
) } @@ -38,13 +44,16 @@ const Hero = props => { */ function BannerGroup(props) { return ( - // 左侧英雄区 -
- {/* 动图 */} - - {/* 导航分类 */} - -
+ // 左侧英雄区 +
+ {/* 动图 */} + + {/* 导航分类 */} + +
) } @@ -64,25 +73,43 @@ function Banner(props) { router.push(`${BLOG.SUB_PATH}/${randomPost?.slug}`) } - return
- -