0%

hexo next 设置gitalk评论系统

简介

  • 如何申请gitalk应用

  • 在next主题中设置

  • 初始化

申请gitalk应用

在Github中申请gitalk应用:https://github.com/settings/applications/new

注册时候,会返回client_id,client_secret等信息,之后会用到。

Next主题中设置

打开Next主题的配置文件_config.yml ,找到gitalk 配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Gitalk
# For more information: https://gitalk.github.io, https://github.com/gitalk/gitalk
gitalk:
enable: true
github_id: github_user_name # GitHub repo owner
repo: github_user_name.github.io # Repository name to store issues
client_id: # GitHub Application Client ID
client_secret: # GitHub Application Client Secret
admin_user: github_user_name # GitHub repo owner and collaborators, only these guys can initialize gitHub issues
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
language: zh-CN (默认是根据系统环境适配语言)

初始化

启用gitalk之后,接下来做初始化。注意,找一篇标题不长的文章,下拉到最后按照提示进行Github关联即可如果标题过长,会初始化失败。