文章初次宣布在:
hexo到场gitment功用
媒介
Gitment 是作者完成的一款基于 GitHub Issues 的批评体系。支撑在前端直接引入,不需要任何后端代码。能够在页面举行登录、检察、批评、点赞等操纵,同时有完全的 Markdown / GFM 和代码高亮支撑。尤其合适种种基于 GitHub Pages 的静态博客或项目页面。
运用
next(v5.1.4)
支撑
gitment
功用
运用步骤
1. 注册 OAuth Application
点击https://github.com/settings/applications/new注册,注重Authorization callback URL填本身的网站url, 比方我的 https://wangyaxing.cn/
你会获得一个 client ID 和一个 client secret,这个将用于以下的设置中
2.在主题文件下的_config.yml中设置
找到gitment举行设置
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: Your Github ID
github_repo: 新建一个代码堆栈,用于存储批评内容, 这里万万注重增加堆栈称号而不是完全地点
client_id: # MUST HAVE, Github client id for the Gitment
client_secret: # EITHER this or proxy_gateway, Github access secret token for the Gitment
碰到的题目
1. not fund
涌现这个题目的缘由是因为设置ower, repo的时刻错了
repo指的是堆栈称号而不是堆栈地点
2.点击初始化批评报错 Error:validation failed
刚开始看了很多文章, 一向修正next/layout/_partials/comments.swig
, 而且还加了以下内容, 然则修正完以后一向没有起作用, 厥后又查找源码, 发明V5.1.4版本和之前的不太一样, 并不必本身增加一些内容,这也是提示人人查找处理方法时肯定要注重修正的版本号
之前的版本
如今的版本内容以下:
修正next/layout/_third-party/comments/gitment.swig
[图片上传失利…(image-c5fa0f-1536162212603)]
修正ID由默许的window.location.pathname
为 page.date
处理ID长度太长报错题目