From 5dbe4ea1907526eb8006843a5cdeebb8aaaae610 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 27 Jun 2024 10:19:55 +0800 Subject: [PATCH] =?UTF-8?q?Heo=E4=B8=BB=E9=A2=98=E8=B5=84=E6=96=99?= =?UTF-8?q?=E5=8D=A1=E7=89=8C=E6=8C=89=E9=92=AE=E6=94=AF=E6=8C=81=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/heo/components/InfoCard.js | 80 ++++++++++++++++++------------- themes/heo/config.js | 9 +++- 2 files changed, 54 insertions(+), 35 deletions(-) diff --git a/themes/heo/components/InfoCard.js b/themes/heo/components/InfoCard.js index 399efb1f..99d3052f 100644 --- a/themes/heo/components/InfoCard.js +++ b/themes/heo/components/InfoCard.js @@ -1,4 +1,4 @@ -import { ArrowRightCircle, GlobeAlt } from '@/components/HeroIcons' +import { ArrowRightCircle } from '@/components/HeroIcons' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import Link from 'next/link' @@ -18,6 +18,10 @@ export function InfoCard(props) { const router = useRouter() // 在文章详情页特殊处理 const isSlugPage = router.pathname.indexOf('/[prefix]') === 0 + const url1 = siteConfig('HEO_INFO_CARD_URL1', null, CONFIG) + const icon1 = siteConfig('HEO_INFO_CARD_ICON1', null, CONFIG) + const url2 = siteConfig('HEO_INFO_CARD_URL2', null, CONFIG) + const icon2 = siteConfig('HEO_INFO_CARD_ICON2', null, CONFIG) return ( {/* 信息卡牌第一行 */} @@ -45,25 +49,55 @@ export function InfoCard(props) {
{/* 两个社交按钮 */} -
- - - -
-
- {siteConfig('HEO_INFO_CARD_URL', null, CONFIG) && ( - - + {url1 && ( +
+ + - )} -
+
+ )} + {url2 && ( +
+ + + +
+ )}
+ {/* 第三个按钮 */}
) } +/** + * 了解更多按鈕 + * @returns + */ +function MoreButton() { + const url3 = siteConfig('HEO_INFO_CARD_URL3', null, CONFIG) + const text3 = siteConfig('HEO_INFO_CARD_TEXT3', null, CONFIG) + if (!url3) { + return <> + } + return ( + +
+ +
{text3}
+
+ + ) +} + /** * 欢迎语 */ @@ -84,25 +118,3 @@ function GreetingsWords() { ) } - -/** - * 了解更多按鈕 - * @returns - */ -function MoreButton() { - return ( - -
- -
了解更多
-
- - ) -} diff --git a/themes/heo/config.js b/themes/heo/config.js index c8e730ea..c2dccbd3 100644 --- a/themes/heo/config.js +++ b/themes/heo/config.js @@ -42,7 +42,14 @@ const CONFIG = { '🤖️ 数码科技爱好者', '🧱 团队小组发动机' ], - HEO_INFO_CARD_URL: 'https://github.com/tangly1024/NotionNext', // 个人资料底部按钮链接 + + // 个人资料底部按钮 + HEO_INFO_CARD_URL1: '/about', + HEO_INFO_CARD_ICON1: 'fas fa-user', + HEO_INFO_CARD_URL2: 'https://github.com/tangly1024', + HEO_INFO_CARD_ICON2: 'fab fa-github', + HEO_INFO_CARD_URL3: 'https://www.tangly1024.com', + HEO_INFO_CARD_TEXT3: '了解更多', // 用户技能图标 HEO_GROUP_ICONS: [