hexo-theme-ayer/layout/_partial/post/gitalk.ejs

21 lines
848 B
Plaintext
Raw Normal View History

2019-12-03 11:37:44 +00:00
<% if (theme.gitalk.enable) { %>
<div class="gitalk" id="gitalk-container"></div>
<%- css('https://unpkg.com/gitalk/dist/gitalk.css') %>
<%- js('https://unpkg.com/gitalk/dist/gitalk.min.js') %>
<%- js('https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js') %>
<script type="text/javascript">
var gitalk = new Gitalk({
clientID: '<%- theme.gitalk.clientID %>',
clientSecret: '<%- theme.gitalk.clientSecret %>',
repo: '<%- theme.gitalk.repo %>',
owner: '<%- theme.gitalk.owner %>',
admin: ['<%- theme.gitalk.admin %>'],
// id: location.pathname, // Ensure uniqueness and length less than 50
id: md5(location.pathname),
distractionFreeMode: false, // Facebook-like distraction free mode
pagerDirection: 'last'
})
gitalk.render('gitalk-container')
</script>
<% } %>