23 lines
956 B
Plaintext
23 lines
956 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(page.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>
|
|
<% } %> |