From 70f94ede36b4a4d3041f62997a3d7c22d440fc44 Mon Sep 17 00:00:00 2001 From: UPToZ Date: Sun, 25 May 2025 16:32:12 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E7=88=B1=E5=8F=91=E7=94=B5?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E9=85=8D=E7=BD=AE=202.=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E4=B8=BA1.0.4-ce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- settings.yaml | 4 ++++ templates/assets/js/halo.js | 6 +++--- templates/modules/variables/site-config.html | 1 + theme.yaml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/settings.yaml b/settings.yaml index d902784..9ee9199 100644 --- a/settings.yaml +++ b/settings.yaml @@ -753,6 +753,10 @@ spec: url: /apis/api.plugin.halo.run/v1alpha1/plugins/plugin-afdian/afdian/getSponsorList showNum: 3 children: + - $formkit: url + name: powerAddress + label: 爱发电地址 + help: https://ifdian.net - $formkit: url name: powerLink label: 赞助地址 diff --git a/templates/assets/js/halo.js b/templates/assets/js/halo.js index 3159c40..be20084 100644 --- a/templates/assets/js/halo.js +++ b/templates/assets/js/halo.js @@ -374,11 +374,11 @@ let halo = { }, getTopSponsors() { + var address = GLOBAL_CONFIG.source.power.powerAddress; var show_num = GLOBAL_CONFIG.source.power.showNum; var url = GLOBAL_CONFIG.source.power.url; function getPower() { - const url = GLOBAL_CONFIG.source.power.url; let powerStar = document.getElementById("power-star") powerStar.href = GLOBAL_CONFIG.source.power.powerLink fetch(url) @@ -429,7 +429,7 @@ let halo = { `; } else { if (powerStar) { - powerStar.href = "https://ifdian.net/u/" + data[0]["user"].user_id + powerStar.href = address + "/u/" + data[0]["user"].user_id powerStar.innerHTML = `
@@ -447,7 +447,7 @@ let halo = { break; } htmlText += - ` ${value["user"]["name"]}`; + ` ${value["user"]["name"]}`; i = i + 1; } if (document.getElementById("power-item-link")) { diff --git a/templates/modules/variables/site-config.html b/templates/modules/variables/site-config.html index b61ca98..1e077df 100644 --- a/templates/modules/variables/site-config.html +++ b/templates/modules/variables/site-config.html @@ -56,6 +56,7 @@ }, source: { power: { + powerAddress: [[${theme.config.sidebar.power.powerAddress}]], powerLink: [[${theme.config.sidebar.power.powerLink}]], url: [[${theme.config.sidebar.power.url}]], showNum: [[${theme.config.sidebar.power.showNum}]] diff --git a/theme.yaml b/theme.yaml index 009c92a..af69ad9 100644 --- a/theme.yaml +++ b/theme.yaml @@ -52,7 +52,7 @@ spec: issues: https://gitee.com/uptoz/halo-theme-hao/issues settingName: "theme-hao-setting" configMapName: "theme-hao-configMap" - version: "1.0.3-ce" + version: "1.0.4-ce" require: ">=2.20.0" license: - name: "CC BY-SA 4.0"