From 00a7c5e02c8f647f53b8ec88dae2896d31ab6ba8 Mon Sep 17 00:00:00 2001 From: anime Date: Thu, 19 Dec 2024 18:12:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(HEO=E4=B8=BB=E9=A2=98=EF=BC=9A=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=96=87=E6=A1=88=E4=BB=8Econfig=E8=8E=B7=E5=8F=96):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/heo/components/AnalyticsCard.js | 12 ++++++++---- themes/heo/config.js | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/themes/heo/components/AnalyticsCard.js b/themes/heo/components/AnalyticsCard.js index 835f4900917..a6c17e8816d 100644 --- a/themes/heo/components/AnalyticsCard.js +++ b/themes/heo/components/AnalyticsCard.js @@ -11,31 +11,35 @@ export function AnalyticsCard(props) { const today = new Date() const diffTime = today.getTime() - targetDate.getTime() // 获取两个日期之间的毫秒数差值 const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) // 将毫秒数差值转换为天数差值 + const postCountTitle = siteConfig('HEO_POST_COUNT_TITLE', null, CONFIG) + const siteTimeTitle = siteConfig('HEO_SITE_TIME_TITLE', null, CONFIG) + const siteVisitTitle = siteConfig('HEO_SITE_VISIT_TITLE', null, CONFIG) + const siteVisitorTitle = siteConfig('HEO_SITE_VISITOR_TITLE', null, CONFIG) const { postCount } = props return <>
-
文章数:
+
{postCountTitle}
{postCount}
-
建站天数:
+
{siteTimeTitle}
{diffDays} 天
-
访问量:
+
{siteVisitTitle}
-
访客数:
+
{siteVisitorTitle}
diff --git a/themes/heo/config.js b/themes/heo/config.js index 4b6a123b61f..60086b58212 100644 --- a/themes/heo/config.js +++ b/themes/heo/config.js @@ -122,6 +122,12 @@ const CONFIG = { HEO_SOCIAL_CARD_TITLE_3: '点击加入社群', HEO_SOCIAL_CARD_URL: 'https://t.me/storage_qi', + // 底部统计面板文案 + HEO_POST_COUNT_TITLE: '文章数:', + HEO_SITE_TIME_TITLE: '建站天数:', + HEO_SITE_VISIT_TITLE: '访问量:', + HEO_SITE_VISITOR_TITLE: '访客数:', + // ***** 以下配置无效,只是预留开发 **** // 菜单配置 HEO_MENU_INDEX: true, // 显示首页