添加博客访问量
添加博客访问量
问题
由于我使用了AirCloud作为博客主题
由于不明原因,使用不蒜子时显示为原AirCloud预览博客访问量
解决
后选择使用HitKounter,显示正确
全站访问量
博客目录下 Blog\themes\AirCould\layout\_partial\footer.ejs
文件
引入脚本
开头添加
1 | <script src="https://sinacloud.net/egg-lib/hit-kounter/hit-kounter-lc-0.4.1.js"></script> |
添加全站访问量
文末
1 | Created By <a href="https://hexo.io/">Hexo</a> Theme <a href="https://github.com/aircloud/hexo-theme-aircloud">AirCloud</a></p> |
前添加
1 | 全站访问:<span data-hk-site> - </span> |
并注释其前面原博客显示访问量的PV、UV部分
1 | <!-- <span id="busuanzi_container_site_pv"> |
注意 只需在 footer.ejs
文件中引入文件,不需要再 post.ejs
文件中引入。否则会导致无法显示
效果

当前文章访问量
博客目录下 Blog\themes\AirCould\layout\post.ejs
文件
添加单页访问量
将
1 | <span class="attr"><%= __('post.visit') %>: |
修改为
1 | <span class="attr"><%= __('post.visit') %>: |
效果
