0%

hexo评论功能(三)

引言

​ next主题内置多种第三方评论系统,如disqus

1
2
3
4
5
comments:
# Available values: tabs | buttons
style: tabs
# Choose a comment system to be displayed by default.
# Available values: changyan | disqus | disqusjs | gitalk | livere | valine

但是disqus由于种种原因无法访问,valine需要身份证号码进行实名登记

所以我选择了gitalk,他是利用github的issue来作为评论,真是github全家桶

开启gitalk

1
2
3
4
5
6
7
8
9
10
11
gitalk:
enable: true # 开启
github_id: github账户名 # github账户名
repo: johnson329.github.io # 博客的仓库名
client_id: # GitHub Application Client ID
client_secret: # GitHub Application Client Secret
admin_user: johnson329 # github账户名
distraction_free_mode: true # Facebook-like distraction free mode
# Gitalk's display language depends on user's browser or system environment
# If you want everyone visiting your site to see a uniform language, you can set a force language value
# Available values: en | es-ES | fr | ru | zh-CN | zh-TW

创建Github Oauth App

settings>developer settings>oauth apps

  • clent_idclient_secret填到上面的配置中

github oauth 配置

  • 设置回调地址(页面调用github,github完成用户认证,回过头来重定向到你的主页,叫回调)

github oauth 回调地址