hexo-theme-keep/layout/_partial/comment/gitalk.ejs

23 lines
855 B
Plaintext
Raw Normal View History

2020-10-29 15:42:58 +08:00
<% if(
theme.comment.gitalk.enable
&& theme.comment.gitalk.client_id
&& theme.comment.gitalk.client_secret
&& theme.comment.gitalk.github_id
&& theme.comment.gitalk.repository
) { %>
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
const gitalk = new Gitalk({
clientID: '<%= theme.comment.gitalk.client_id %>',
clientSecret: '<%= theme.comment.gitalk.client_secret %>',
repo: '<%= theme.comment.gitalk.repository %>',
owner: '<%= theme.comment.gitalk.github_id %>',
admin: ['<%= theme.comment.gitalk.github_id %>'],
id: location.pathname,
language: '<%= config.language %>'
})
gitalk.render('gitalk-container')
</script>
<% } %>