From 89cb6a585aa43b447e35c9c83fc234aa6ef7b368 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Mon, 13 Oct 2025 13:50:52 +0800 Subject: [PATCH] fix(theme): fix `fontawesome` icon, close #720 (#721) --- plugins/plugin-md-power/src/node/icon/prepareIcon.ts | 4 ++-- theme/src/client/components/VPIconFa.vue | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/plugin-md-power/src/node/icon/prepareIcon.ts b/plugins/plugin-md-power/src/node/icon/prepareIcon.ts index f7cdc8b6..903eeac4 100644 --- a/plugins/plugin-md-power/src/node/icon/prepareIcon.ts +++ b/plugins/plugin-md-power/src/node/icon/prepareIcon.ts @@ -11,7 +11,7 @@ interface AssetInfo { } function getFontAwesomeCDNLink(type: string): string { - return `https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/js/${type}.min.js` + return `https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/js/${type}.min.js` } export function prepareIcon( @@ -38,7 +38,7 @@ export function prepareIcon( if (asset === 'fontawesome-with-brands') { return normalizeAsset(getFontAwesomeCDNLink('brands'), 'fontawesome') } - return null + return normalizeAsset(asset, 'fontawesome') }).flat().filter(notNullish)) } let hasStyle = false diff --git a/theme/src/client/components/VPIconFa.vue b/theme/src/client/components/VPIconFa.vue index 2a574916..80f69928 100644 --- a/theme/src/client/components/VPIconFa.vue +++ b/theme/src/client/components/VPIconFa.vue @@ -56,6 +56,8 @@ const extraClasses = computed(() => {