Fork me on GitHub

为博客添加评论功能

注册

https://github.com/settings/applications/new

在Authorization callback URL填写自己的网站

记录下来Client ID 和 Client Secret

在themes/next/_config.yml进行配置

1
2
3
4
5
6
7
8
9
10
11
12
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: true # 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: Hughendman # MUST HAVE, Your Github ID
github_repo: Hughendman.github.io # MUST HAVE, The repo you use to store Gitment comments
client_id: Client ID # MUST HAVE, Github client id for the Gitment
client_secret: Client Secret # EITHER this or proxy_gateway, Github access secret token for the Gitment
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

解决中文问题

1
npm install hexo-abbrlink --save

站点配置文件里:

1
2
3
4
permalink: post/:abbrlink.html
abbrlink:
alg: crc32 # 算法:crc16(default) and crc32
rep: hex # 进制:dec(default) and hex
显示 Gitment 评论