✨ disqus/disqusjs/facebook comments 可隨夜間模式按鈕切換而轉換主題

🐛 修復pjax下valine評論顯示不正常的bugs
🐛 修復facebook comments 在手機下寬度不是100%的bugs
This commit is contained in:
Jerry committed 2020-07-18 22:30:15 +08:00
1 parent f7d57ac883
commit 4f64768011
17 files changed
+107 -85

No files matched your search

+2 -2
View File
@@ -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
+9 -3
View File
@@ -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})
+8 -4
View File
@@ -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