404

Hugo PaperMod主题添加不蒜子Busuanzi浏览统计

不蒜子Busuanzi浏览统计 Busuanzi 我是使用了Git的子模块进行主题的管理,所以为了保持子模块的完整性,所有修改都在Hugo框架中进行。 head.html 复制 head.html文件位于[Hugo_blog]/themes/PaperMod/layouts/partials/head.html 至 [Hugo_blog]/layouts/partials/head.html (如没有文件夹需要自己创建) 搜索{{- /* Styles */}} 在其上一行添加代码: 1 2 3 4 {{- if .Site.Params.busuanzi.enable -}} <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <meta name="referrer" content="no-referrer-when-downgrade"> {{- end -}} footer.html 复制 footer.html文件位于[Hugo_blog]/themes/PaperMod/layouts/partials/footer.html 至 [Hugo_blog]/layouts/partials/footer.html (如没有文件夹需要自己创建) 在footer标签中,添加新代码: 1 2 3 4 5 6 7 8 9 10 {{ if .Site.Params.busuanzi.enable -}} <div class="busuanzi-footer"> <span id="busuanzi_container_site_pv"> 本站总访问量<span id="busuanzi_value_site_pv"></span>次 </span> <span id="busuanzi_container_site_uv"> 本站访客数<span id="busuanzi_value_site_uv"></span>人次 </span> </div> {{- end -}} single.html 复制...

2024-01-03 · 1 min · 108 words · 0x4b404ec
404

Hugo PaperMod主题添加utterances评论

Hugo PaperMod主题添加utterances评论 What is ‘utterances’ https://utteranc.es/ utterances 是一款基于 GitHub issues 的开源评论插件. 主打免费开源~ 安装Utterances 申请Github App 打开 Utterances 进行安装 选择要连接的库 确保选择的库是公开(public)的,否则你的读者将无法查看问题/评论。 确保在对应库安装应用程序,否则用户将无法发表评论。 如果你的库是fork的一个分支,在设置页面中并确保issues功能是打开的。 修改站点配置文件 在根目录layouts\partials下创建comments.html文件并编辑(注意不是主题文件夹中的layouts) 1 2 3 4 5 6 7 8 9 10 11 {{- /* Comments area start */ -}} {{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}} <script src="https://utteranc.es/client.js" repo="安装app的个人库名" issue-term="title" label="Comment" theme="github-light" crossorigin="anonymous" async> </script> {{- /* Comments area end */ -}} 其中 repo格式类似于:0x4b404ec/0x4b404ec.github.io...

2024-01-01 · 1 min · 77 words · 0x4b404ec