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

23 lines
954 B
Plaintext
Raw Normal View History

2020-04-14 21:18:37 +08:00
<% if(
theme.comments.gitalk.enable
&& theme.comments.gitalk.client_id
&& theme.comments.gitalk.client_secret
&& theme.comments.gitalk.github_id
&& theme.comments.gitalk.repo
) { %>
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
const gitalk = new Gitalk({
clientID: '<%= theme.comments.gitalk.client_id %>',
clientSecret: '<%= theme.comments.gitalk.client_secret %>',
repo: '<%= theme.comments.gitalk.repository %>',
owner: '<%= theme.comments.gitalk.github_id %>',
admin: ['<%= theme.comments.gitalk.github_id %>'],
id: location.pathname,
distractionFreeMode: Boolean('<%= theme.comments.gitalk.distraction_free_mode %>'),
language: '<%= config.language %>'
})
gitalk.render('gitalk-container')
</script>
<% } %>