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"