Skip to content

Commit cf7b24e

Browse files
committed
vault backup: 2026-01-12 21:38:34
1 parent e6a446c commit cf7b24e

1 file changed

Lines changed: 23 additions & 11 deletions

File tree

_config.butterfly.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,21 +1076,33 @@ structured_data:
10761076
# Add the vendor prefixes to ensure compatibility
10771077
css_prefix: true
10781078

1079-
# Inject
1080-
# Insert the code to head (before '</head>' tag) and the bottom (before '</body>' tag)
1081-
# inject:
1082-
# head:
1083-
# # - <link rel="stylesheet" href="/xxx.css">
1084-
# bottom:
1085-
# # - <script src="xxxx"></script>
1086-
1087-
# # _config.butterfly.yml
1088-
10891079
inject:
10901080
head:
10911081
bottom:
1092-
# 把下面这行加进去!注意缩进!替换 '你的Waline地址'
1082+
# 1. Waline 初始化脚本 (负责评论和文章阅读量)
10931083
- <script type="module">import { init } from 'https://unpkg.com/@waline/client/v2/dist/waline.mjs'; init({ el: '#waline', serverURL: 'https://144.24.80.205.sslip.io', visitor: true });</script>
1084+
1085+
# 2. 【关键】侧边栏全站统计补丁 (负责把转圈圈变成数字)
1086+
- <script>
1087+
(function() {
1088+
// 设置你的 Waline 地址
1089+
const serverURL = 'https://144.24.80.205.sslip.io';
1090+
1091+
// 主动去取全站数据
1092+
fetch(`${serverURL}/stats/site`)
1093+
.then(res => res.json())
1094+
.then(data => {
1095+
// 找到侧边栏的元素
1096+
const uvElements = document.querySelectorAll('.waline-site-uv');
1097+
const pvElements = document.querySelectorAll('.waline-site-pv');
1098+
1099+
// 填入数据 (把转圈的图标覆盖掉)
1100+
uvElements.forEach(el => el.innerText = data.site_uv);
1101+
pvElements.forEach(el => el.innerText = data.site_pv);
1102+
})
1103+
.catch(err => console.error('Waline 统计获取失败:', err));
1104+
})();
1105+
</script>
10941106

10951107
# CDN Settings
10961108
# Don't modify the following settings unless you know how they work

0 commit comments

Comments
 (0)