hexo-theme-amane/layout/comment/gitment.ejs

23 lines
951 B
Plaintext

<% if (!has_config('comment.owner') || !has_config('comment.repo') || !has_config('comment.client_id') ||
!has_config('comment.client_secret')) { %>
<div class="notification is-danger">
You forgot to set the <code>owner</code>, <code>repo</code>, <code>client_id</code>, or <code>client_secret</code> for Gitment.
Please set it in <code>_config.yml</code>.
</div>
<% } else { %>
<div id="comment-container"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
var gitment = new Gitment({
id: '<%= md5(path) %>',
owner: '<%= get_config('comment.owner') %>',
repo: '<%= get_config('comment.repo') %>',
oauth: {
client_id: '<%= get_config('comment.client_id') %>',
client_secret: '<%= get_config('comment.client_secret') %>',
},
})
gitment.render('comment-container')
</script>
<% } %>