From e04128ed4ce3090562b885c4768fd516d590acd0 Mon Sep 17 00:00:00 2001 From: Heathcliff <99589321+Heathcliff-third-space@users.noreply.github.com> Date: Tue, 14 Nov 2023 15:33:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8Dheo=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E4=BB=8ENotionConfig=E8=AF=BB=E5=8F=96=E5=A4=B1=E8=B4=A5Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认从NotionConfig读取为字符串,此时会导致notices获取失败 --- themes/heo/components/NoticeBar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/heo/components/NoticeBar.js b/themes/heo/components/NoticeBar.js index 064a3844..1ef5aa1e 100644 --- a/themes/heo/components/NoticeBar.js +++ b/themes/heo/components/NoticeBar.js @@ -8,8 +8,10 @@ import { siteConfig } from '@/lib/config' * 通知横幅 */ export function NoticeBar() { - const notices = siteConfig('HEO_NOTICE_BAR', null, CONFIG) - + let notices = siteConfig('HEO_NOTICE_BAR', null, CONFIG) + if (typeof notices === 'string') { + notices = JSON.parse(notices) + } if (!notices || notices?.length === 0) { return <> }