mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-17 04:40:53 +08:00
add disqus.js
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
if theme.disqus && theme.disqus.enable
|
||||
#disqus_thread
|
||||
link(href=('https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqusjs.css') rel='stylesheet')
|
||||
script(src=('https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqus.js'))
|
||||
script.
|
||||
var dsqjs = new DisqusJS({
|
||||
shortname: '!{theme.disqus.shortname}',
|
||||
siteName: "!{theme.disqus.siteName}",
|
||||
identifier: '!{ page.path }',
|
||||
url: '!{ page.permalink }',
|
||||
title: '!{ page.title }',
|
||||
api: '!{theme.disqus.api}',
|
||||
apikey: '!{theme.disqus.apikey}',
|
||||
admin: '',
|
||||
adminLabel: ''
|
||||
});
|
||||
var unused = null;
|
||||
var disqus_config = function () {
|
||||
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);
|
||||
Reference in New Issue
Block a user