This commit is contained in:
Jerry
2020-07-16 19:30:54 +08:00
Unverified
parent 5b6e008b84
commit 898cc31c58
93 changed files with 2128 additions and 2151 deletions

View File

@@ -1,20 +1,29 @@
#disqus_thread
script.
function loadDisqus () {
var disqus_config = function () {
this.page.url = '!{ page.permalink }';
this.page.identifier = '!{ page.path }';
this.page.title = '!{ page.title }';
this.page.url = '!{ page.permalink }'
this.page.identifier = '!{ page.path }'
this.page.title = '!{ page.title }'
};
var d = document, s = d.createElement('script');
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
if (window.DISQUS) {
DISQUS.reset({
reload: true,
config: disqus_config
})
} else {
(function() {
var d = document, s = d.createElement('script')
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js'
s.setAttribute('data-timestamp', +new Date())
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
}
}
if ('!{defaultComment}' === 'Disqus' || !{theme.comments.load_begin}) {
window.addEventListener('load', loadDisqus)
loadDisqus()
}
else {
function loadOtherComment () {
@@ -22,6 +31,7 @@ script.
}
}
if is_post() && theme.comments.count && defaultComment === 'Disqus'
script.
function getDisqusCount() {
@@ -31,4 +41,4 @@ if is_post() && theme.comments.count && defaultComment === 'Disqus'
(d.head || d.body).appendChild(s);
}
window.addEventListener('load', getDisqusCount, false);
getDisqusCount()