跳过正文
  1. Hugo博客相关/

hugo博客-blowfish主题添加giscus作为评论系统

·322 字·1 分钟·
Hugo Blowfish Comments
古德
作者
古德
目录

添加giscus,用于博客交流。

1. 创建评论相关文件
#

1.1 创建comments.html文件
#

  • 在layouts/partials目录下创建comments.html
    • 以下参数来自giscus,具体参考官网https://giscus.app/zh-CN
<script src="https://giscus.app/client.js"
        data-repo="xxx/xxx"
        data-repo-id="xxxx"
        data-category="Announcements"
        data-category-id="xxxx"
        data-mapping="pathname"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="top"
        data-theme="preferred_color_scheme"
        data-lang="zh-CN"
        data-loading="lazy"
        crossorigin="anonymous"
        async>
</script>

2. 添加配置
#

2.1 config.toml中添加配置
#

  • 在themes/blowfish/config.toml中添加如下配置
    • 以下参数来自giscus,具体参考官网https://giscus.app/zh-CN
[params.giscus]
    data-repo="xxx/xxxx"
    data-repo-id="xxx"
    data-category="Announcements"
    data-category-id="xxx"
    data-mapping="pathname"
    data-strict="0"
    data-reactions-enabled="1"
    data-emit-metadata="0"
    data-input-position="top"
    data-theme="preferred_color_scheme"
    data-lang="zh-CN"
    data-loading="lazy"
    crossorigin="anonymous"

2.2 params.toml中添加配置
#

  • config/_default/params.toml中添加如下配置
    • showComments = true
[article]
  showDate = true
  ...
  showWordCount = true
  showComments = true

相关文章

k8s(kubectl get cs)健康检查报错
·370 字·1 分钟
Kubernetes Unhealthy
windows笔记本wifi连接正常上不了网
·195 字·1 分钟
Os Windows Wifi
各类工具网址记录
·343 字·1 分钟
Net Https Tools
Windows通过KTConnect连接服务器K8S集群
·768 字·2 分钟
Kubernetes Ktconnect Windows Proxy
Gitlab-ce中文版安装及维护
·207 字·1 分钟
Os Linux Gitlab-Ce
Linux系统内核升级
·943 字·2 分钟
Os Linux Kernel Centos7