From c09cd98075a5f07acea216e7cfb16772a2de440b Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Tue, 19 Mar 2024 00:33:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(theme):=20=E6=96=B0=E5=A2=9E=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=A0=8F=E7=A4=BE=E4=BA=A4=E5=9B=BE=E6=A0=87=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/client/components/Nav/NavBarExtra.vue | 14 +++++++-- .../components/Nav/NavBarSocialLinks.vue | 15 ++++++++-- theme/src/node/defaultOptions.ts | 1 + theme/src/shared/options/locale.ts | 29 +++++++++++++++++-- 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/theme/src/client/components/Nav/NavBarExtra.vue b/theme/src/client/components/Nav/NavBarExtra.vue index 5a49bca9..f0f20022 100644 --- a/theme/src/client/components/Nav/NavBarExtra.vue +++ b/theme/src/client/components/Nav/NavBarExtra.vue @@ -13,6 +13,16 @@ const { localeLinks, currentLang } = useLangs({ correspondingLink: true }) const hasExtraContent = computed( () => theme.value.appearance || theme.value.social, ) + +const social = computed(() => { + const includes = theme.value.navbarSocialInclude ?? [] + if (!includes.length) + return theme.value.social + + return theme.value.social?.filter( + ({ icon }) => typeof icon === 'string' && includes.includes(icon), + ) +})