mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 18:50:53 +08:00
26 lines
834 B
Plaintext
26 lines
834 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}',
|
|
nocomment: '!{theme.disqusjs.nocomment}',
|
|
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);
|