跳过正文
hugo博客评论系统
  1. 捣鼓日常/
  2. hugo/

hugo博客评论系统

·288 字·1 分钟·
hugo博客开发 - 这篇文章属于一个选集。
§ 3: 本文

Blowfish 支持了在每篇文章底部添加一个评论功能。只需要提供一个 layouts/partials/comments.html 文件,并在其中添加显示评论的代码即可。 我是使用Giscus(基于Github的Discussions)

  1. 在Github打开Discussions
  2. 安装Giscus 访问giscus.app,按步骤配置:
  • 输入你的 GitHub 仓库(格式:用户名/仓库名)
  • 选择 “Discussions” 作为评论来源
  • 选择主题(推荐 preferred_color_scheme 跟随系统)
  • 复制生成的配置代码
  1. Blowfish中配置 在在hugo.toml中添加:
[giscus]
  enabled = true
  repo = "仓库地址"
  repoID = "R_kgDOJxxxxxxxx"  # 在 giscus.app 获取
  category = "Announcements"
  categoryID = "DIC_kwDOJxxxxxxxx"  # 在 giscus.app 获取
  mapping = "pathname"
  strict = "0"
  reactionsEnabled = "1"
  emitMetadata = "0"
  inputPosition = "top"
  theme = "catppuccin_frappe"
  lang = "zh-CN"
  loading = "lazy"

这个是在giscus官网生成的,不要复制我的

RuChen
作者
RuChen
hugo博客开发 - 这篇文章属于一个选集。
§ 3: 本文