Hexo next主题使用gitment评论

之前关闭的关闭,翻墙的翻墙,最后选择了Hypercomments,最近发现全部收费了。只好再换,想来github总不会挂了。于是转用gitment.

如何使用

可以参照官网 https://github.com/imsun/gitment#get-started

我的修改过程

首先,注释掉Hypercomments的配置。然后找到

1
2
3
4
5
6
7
8
9
10
11
12
13
gitment:
enable: true
mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway
count: true # Show comments count in post meta area
lazy: false # Comments lazy loading with a button
cleanly: false # Hide 'Powered by ...' on footer, and more
language: # Force language, or auto switch by theme
github_user: Ryan-Miao
github_repo: Ryan-Miao.github.io
client_id: <yours>
client_secret: <yours>
proxy_gateway: # Address of api proxy, See: https://github.com/aimingoo/intersect
redirect_protocol: # Protocol of redirect_uri with force_redirect_protocol when mint enabled

在这之前,需要去github注册一个第三方用户,把自己的网站注册。

注册地址: https://github.com/settings/applications/new

Application name, 我填写博客名称
Homepage URL, 我填写博客首页地址
Application desc, 随意
Application callback URL, 这个我填博客域名,即 https://blog.rmiao.top

然后,生成id和secret, 修改上述配置文件,

1
npm i --save gitment

发布。打开一篇文章,最后面,登录github, 然后有一个初始化本页评论的按钮,点击就好。

Ryan Miao wechat
关注我的公众账号,接收最新文章
Donate
0%