Closed dbarobin closed 6 years ago
已解决,感谢。
您好,请问您是怎么解决的?有哪些注意事项吗?期待您的留言
themes/BlueLake/_config.yml
文件添加:
#Cmments
comment:
gitment:
id: window.location.pathname
owner:
repo:
client_id:
client_secret:
themes/BlueLake/layout/_partial/comments.jade
文件添加
if theme.comment.gitment && theme.comment.gitment.owner && theme.comment.gitment.repo && theme.comment.gitment.client_id && theme.comment.gitment.client_secret
#container
link(rel='stylesheet', href='https://imsun.github.io/gitment/style/default.css')
script(src='https://imsun.github.io/gitment/dist/gitment.browser.js')
script.
var gitment = new Gitment({
owner: '#{theme.comment.gitment.owner}',
repo: '#{theme.comment.gitment.repo}',
oauth: {
client_id: '#{theme.comment.gitment.client_id}',
client_secret: '#{theme.comment.gitment.client_secret}',
},
})
gitment.render('container')
需要注意的是,gitment 不支持 GitHub 组织添加评论。
看了 Gitment 相关 使用说明,但不清楚应该将以下代码放在什么地方。
非常感谢。