mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-04 14:22:01 +08:00
✨ disqus/disqusjs/facebook comments 可隨夜間模式按鈕切換而轉換主題
🐛 修復pjax下valine評論顯示不正常的bugs 🐛 修復facebook comments 在手機下寬度不是100%的bugs
This commit is contained in:
1 parent
f7d57ac883
commit
4f64768011
17 files changed
+108
-86
No files matched your search
+2
-2
@@ -701,10 +701,10 @@ note:
|
|||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
# https://github.com/MoOx/pjax
|
# https://github.com/MoOx/pjax
|
||||||
pjax: true
|
pjax: false
|
||||||
|
|
||||||
# Inject the css and script (aplayer/meting)
|
# Inject the css and script (aplayer/meting)
|
||||||
aplayerInject: true
|
aplayerInject: false
|
||||||
|
|
||||||
# Snackbar (Toast Notification 彈窗)
|
# Snackbar (Toast Notification 彈窗)
|
||||||
# https://github.com/polonel/SnackBar
|
# https://github.com/polonel/SnackBar
|
||||||
|
|||||||
@@ -78,13 +78,19 @@ div
|
|||||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
script(async src=url_for(theme.CDN.busuanzi))
|
script(async src=url_for(theme.CDN.busuanzi))
|
||||||
|
|
||||||
|
if theme.pjax && theme.comments && theme.comments.use
|
||||||
|
!=partial('includes/comments/js-load-all', {}, {cache:theme.fragment_cache})
|
||||||
|
else if commentsJsLoad
|
||||||
|
!=partial('includes/comments/js-load-all', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if theme.aplayerInject
|
if theme.aplayerInject
|
||||||
if theme.pjax
|
if theme.pjax
|
||||||
include ./head/aplayer.pug
|
include ./head/aplayer.pug
|
||||||
else if page.aplayer
|
else if page.aplayer
|
||||||
include ./head/aplayer.pug
|
include ./head/aplayer.pug
|
||||||
|
|
||||||
if theme.pjax
|
|
||||||
include ./third-party/pjax.pug
|
|
||||||
|
|
||||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||||
|
|
||||||
|
if theme.pjax
|
||||||
|
!=partial('includes/third-party/pjax', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
@@ -6,11 +6,15 @@ script.
|
|||||||
this.page.title = '!{ page.title }'
|
this.page.title = '!{ page.title }'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (window.DISQUS) {
|
window.disqusReset = () => {
|
||||||
DISQUS.reset({
|
DISQUS.reset({
|
||||||
reload: true,
|
reload: true,
|
||||||
config: disqus_config
|
config: disqus_config
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.DISQUS) {
|
||||||
|
disqusReset()
|
||||||
} else {
|
} else {
|
||||||
(function() {
|
(function() {
|
||||||
var d = document, s = d.createElement('script')
|
var d = document, s = d.createElement('script')
|
||||||
@@ -34,11 +38,11 @@ script.
|
|||||||
|
|
||||||
if is_post() && theme.comments.count && defaultComment === 'Disqus'
|
if is_post() && theme.comments.count && defaultComment === 'Disqus'
|
||||||
script.
|
script.
|
||||||
function getDisqusCount() {
|
if (window.DISQUSWIDGETS === undefined) {
|
||||||
var d = document, s = d.createElement('script');
|
var d = document, s = d.createElement('script');
|
||||||
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
|
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
|
||||||
s.id = 'dsq-count-scr';
|
s.id = 'dsq-count-scr';
|
||||||
(d.head || d.body).appendChild(s);
|
(d.head || d.body).appendChild(s);
|
||||||
|
} else {
|
||||||
|
DISQUSWIDGETS.getCount({reset: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
getDisqusCount()
|
|
||||||
Loaded 3 of 17 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user