本文最后更新于:2024年1月14日 晚上

使用nextV7.7.1 主题时,在hexo中添加live2D看板娘后next原生自带的不蒜子统计会失效,本文介绍该问题的修复方法。

问题复现

开启next 主题中不蒜子统计:

1
2
3
4
5
6
7
8
9
10
# Show Views / Visitors of the website / page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi
busuanzi_count:
enable: true
total_visitors: true
total_visitors_icon: user
total_views: true
total_views_icon: eye
post_views: true
post_views_icon: eye

安装live2d插件:

1
npm install --save hexo-helper-live2d

问题出现:

修复bug

方法1. 卸载livd2d

卸载live2d可以解决问题:

1
npm uninstall --save hexo-helper-live2d

方法2. 手动重新添加不蒜子

看板娘怎么可以卸载????? 绝对不能接受!!!

  • 关闭next原生不蒜子
1
2
3
4
5
6
7
8
9
10
# Show Views / Visitors of the website / page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi
busuanzi_count:
enable: false
total_visitors: true
total_visitors_icon: user
total_views: true
total_views_icon: eye
post_views: true
post_views_icon: eye

修复主页总数统计

  • Hexo根目录/themes/next/layout/_partials/文件夹中修改 footer.swig,在最后一行前加入代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span><br></span>

<span class="post-meta-item-icon">
<i class="fa fa-group"></i>
</span>
<span>总访客&nbsp<span id="busuanzi_value_site_uv"></span>&nbsp人</span>
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span>访问总量&nbsp<span id="busuanzi_value_site_pv"></span>&nbsp次</span>

{{- next_inject('footer') }}

效果:

修复文章统计

可以通过开启 主题配置文件 - valine 评论中的 visitor 开关来替代不蒜子的统计功能。

1
2
3
4
valine:
enable: true
...
visitor: true # Article reading statistic

开启valine方法参考Next -6- 添加Valine评论系统



文章链接:
https://www.zywvvd.com/notes/hexo/theme/next/13-busuanzi-fix-for-live2d/next-busuanzi-fix-live2d/


“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”

微信二维码

微信支付

支付宝二维码

支付宝支付

Next -13- 修复由于添加live2D造成的不蒜子统计失效
https://www.zywvvd.com/notes/hexo/theme/next/13-busuanzi-fix-for-live2d/next-busuanzi-fix-live2d/
作者
Yiwei Zhang
发布于
2020年3月9日
许可协议