9

给 Hugo even 主题添加 utterances 评论系统

 4 years ago
source link: https://jdhao.github.io/2021/08/15/hugo_even_add_utterance/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

给 Hugo even 主题添加 utterances 评论系统

2021-08-15485 words 1 min read 7 times read

建立博客以来,试用了多款评论系统,不过最终还是用了 disqus,但是 disqus 讨厌的是默认会添加很多烦人的广告,牛皮癣一样。utterances 是一款基于 github issue 的评论系统,很简洁,避免了 disqus 的广告以及加载问题。这篇文章总结如何给 Hugo-even 主题添加 utterances 评论系统。

我们需要进行以下几步操作:

  1. 建立一个 public GitHub 仓库,这个仓库的 issue 用来存放博客评论:如果自己的博客就是用 GitHub pages 建立的,那么就不需要额外建立仓库了,就用博客的仓库也可以。例如我的博客放在 jdhao/jdhao.github.io这个仓库,就可以用这个仓库存放博客的评论。

  2. 安装 utterances 的 app:install 以后,在 Repository access,选择 Only select repositories,然后选择自己建立的用来存放评论的仓库即可。这时,进入到对应仓库的设置界面,点击 Integrations,会看到 utterances 的 app。

  3. Hugo even 对应的设置:先把 even 更新到最新版,然后在博客的 config.toml 配置文件,加入下面的配置:

    # owner 填自己的 github 账号,repo 填用来存放评论的仓库名字
    [params.utterances]
        owner = "jdhao"
        repo = "jdhao.github.io"
    
  4. 重新 deploy Hugo 博客,等博客更新以后,utterances 评论系统即可生效。

要在博客文章下面评论,只需要登录自己的 GitHub 账号即可。

References

Author jdhao

LastMod 2021-08-15

License CC BY-NC-ND 4.0

Reward
macOS Operation Not Permitted?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK