mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
🐛 2.修復評論utterances 在display_mode設置為dark時,仍顯示light主題的bug 🐛 3.修復display_mode設置dark沒有效果的bug 🎨 4.評論增加夜間模式、文章頁判斷,減少不必要的js加載
25 lines
788 B
Plaintext
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);
|