diff --git a/assets/js/lib/utterances.js b/assets/js/lib/utterances.js index 2888768f0..c69bb0625 100644 --- a/assets/js/lib/utterances.js +++ b/assets/js/lib/utterances.js @@ -18,5 +18,7 @@ if (window.config?.comment?.utterances) { const iframe = document.querySelector('.utterances-frame') iframe.contentWindow.postMessage(message, 'https://utteranc.es') } + console.log(window.switchThemeEventSet) window.switchThemeEventSet.add(window._utterancesOnSwitchTheme) + console.log(window.switchThemeEventSet) } diff --git a/assets/js/theme.js b/assets/js/theme.js index 7358bd383..ce1595c88 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -775,7 +775,6 @@ function init () { window.oldScrollTop = window.newScrollTop window.scrollEventSet = new Set() window.resizeEventSet = new Set() - window.switchThemeEventSet = new Set() window.clickMaskEventSet = new Set() if (window.objectFitImages) objectFitImages() initSVGIcon() diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 0d9178ad1..3034c23cf 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -389,9 +389,9 @@ cacheRemoteImages = false # Utterances comment config (https://utteranc.es/) # Utterances comment 评论系统设置 (https://utteranc.es/) [page.comment.utterances] - enable = false + enable = true # owner/repo - repo = "" + repo = "Hugo-DoIt/utterances-comments" issueTerm = "pathname" label = "" lightTheme = "github-light" @@ -399,7 +399,7 @@ cacheRemoteImages = false # Twikoo comment config (https://twikoo.js.org/) # Twikoo comment 评论系统设置 (https://twikoo.js.org/) [page.comment.twikoo] - enable = true + enable = false envId = "https://twikoo-comments-doit.vercel.app/" region = "" path = "" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 06f76e5af..5f852f6e5 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -22,12 +22,13 @@ {{- /* Check theme isDark before body rendering */ -}} {{- $theme := .Site.Params.defaulttheme -}}