22 lines
1.0 KiB
Plaintext
22 lines
1.0 KiB
Plaintext
![]() |
<% if (!has_config('comment.owner') || !has_config('comment.admin') || !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>admin</code>, <code>repo</code>, <code>client_id</code>, or <code>client_secret</code> for Gittalk.
|
||
|
Please set it in <code>_config.yml</code>.
|
||
|
</div>
|
||
|
<% } else { %>
|
||
|
<div id="comment-container"></div>
|
||
|
<%- _css(cdn('gitalk', '1.4.1', 'dist/gitalk.css')) %>
|
||
|
<%- _js(cdn('gitalk', '1.4.1', 'dist/gitalk.min.js')) %>
|
||
|
<script>
|
||
|
var gitalk = new Gitalk({
|
||
|
clientID: '<%= get_config('comment.client_id') %>',
|
||
|
clientSecret: '<%= get_config('comment.client_secret') %>',
|
||
|
id: '<%= md5(page.path) %>',
|
||
|
repo: '<%= get_config('comment.repo') %>',
|
||
|
owner: '<%= get_config('comment.owner') %>',
|
||
|
admin: <%- JSON.stringify(get_config('comment.admin'))%>
|
||
|
})
|
||
|
gitalk.render('comment-container')
|
||
|
</script>
|
||
|
<% } %>
|