hexo-theme-butterfly/layout/includes/comments/disqusjs.pug
Jerry 67c013d6e7 🐛 1.修復Gitalk報Error: Cannot read property 'repository' of undefined 的bug
🐛 2.修復評論utterances 在display_mode設置為dark時,仍顯示light主題的bug
🐛 3.修復display_mode設置dark沒有效果的bug
🎨 4.評論增加夜間模式、文章頁判斷,減少不必要的js加載
2020-03-18 18:44:39 +08:00

25 lines
788 B
Plaintext

#disqus_thread
script(src=url_for(theme.CDN.disqusjs))
script.
var dsqjs = new DisqusJS({
shortname: '!{theme.disqusjs.shortname}',
siteName: "!{theme.disqusjs.siteName}",
identifier: '!{ page.path }',
url: '!{ page.permalink }',
title: '!{ page.title }',
api: '!{theme.disqusjs.api}',
apikey: '!{theme.disqusjs.apikey}',
admin: '!{theme.disqusjs.admin}',
adminLabel: '!{theme.disqusjs.adminLabel}'
});
if is_post() && theme.disqusjs.count
script.
function getDisqusCount() {
var d = document, s = d.createElement('script');
s.src = 'https://!{theme.disqusjs.shortname}.disqus.com/count.js';
s.id = 'dsq-count-scr';
(d.head || d.body).appendChild(s);
}
window.addEventListener('load', getDisqusCount, false);