mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
✨ 增加mac light 代碼框 ✨ 增加文章過期提醒配置 ✨ 文章copyright 可單獨配置 ✨ card-category 中category名稱和數字限制一行顯示 ✨ 簡繁轉換優化,placeholder文字也會被轉換 🐛 修復配置PWA參數時,如果網站是子目錄時,會出現加載不到文件的bugs 調整當card-category有收縮按鈕時的顯示佈局
34 lines
1021 B
Plaintext
34 lines
1021 B
Plaintext
#disqus_thread
|
|
script.
|
|
function loadDisqus () {
|
|
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);
|
|
}
|
|
|
|
if ('!{defaultComment}' === 'Disqus' || !{theme.comments.load_begin}) {
|
|
window.addEventListener('load', loadDisqus)
|
|
}
|
|
else {
|
|
function loadOtherComment () {
|
|
loadDisqus()
|
|
}
|
|
}
|
|
|
|
if is_post() && theme.comments.count && defaultComment === 'Disqus'
|
|
script.
|
|
function getDisqusCount() {
|
|
var d = document, s = d.createElement('script');
|
|
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
|
|
s.id = 'dsq-count-scr';
|
|
(d.head || d.body).appendChild(s);
|
|
}
|
|
|
|
window.addEventListener('load', getDisqusCount, false); |