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

22 lines
864 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
2020-04-15 09:31:44 +08:00
&& theme.comments.gitalk.repository
2020-04-14 21:18:37 +08:00
) { %>
<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,
language: '<%= config.language %>'
})
gitalk.render('gitalk-container')
</script>
<% } %>