本文最后更新于:2024年5月7日 下午
Umami 可以统计网页浏览信息,本文记录在 Fluid 主题中加入 Umami 的方法。
前置条件
- 需要配置好 Umami 服务器
- 掌握 Fluid 注入使用方法
操作流程
将 Umami 统计链接注入 Fluid
-
将统计链接注入 Fluid header 中
-
在
scripts/page.js
(没有可以创建) 写入:1
2
3hexo.extend.filter.register('theme_inject', function(injects) {
injects.header.file('video-banner', 'source/_inject/header.ejs', { key: 'value' }, -1);
}); -
在
'source/_inject/header.ejs'
文件中加入统计链接:1
<script async defer data-website-id="xxxxxxxx-57fd-4b1b-8782-xxxxxxxxxx" src="https://xxx.xxx.xxx.xxx/umami.js"></script>
类似原理也可以用 Hexo 的注入机制完成该步骤
在网页中加入链接
我将 Umami 的链接放在 footer 的部分,可以参考一下
-
获取共享链接
-
在
_config.fluid.yml
footer 部分加入共享链接1
<a href= "https://uipv4.zywvvd.com:33030:6287/share/r5OGod2Z/%E5%8F%88%E8%A7%81%E8%8B%8D%E5%B2%9A" target="_blank" rel="nofollow noopener"><span>Umami</span></a>
-
添加效果
参考资料
我的博客即将同步至腾讯云开发者社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=1b5yjjveh76yh
文章链接:
https://www.zywvvd.com/notes/hexo/theme/fluid/fluid-add-umami/fluid-add-umami/
“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”

微信支付

支付宝支付
Fluid -23- 添加 Umami 统计
https://www.zywvvd.com/notes/hexo/theme/fluid/fluid-add-umami/fluid-add-umami/