From 4c2828d289c810ecf4908dc91886644113600e3e Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Mon, 24 May 2021 02:05:35 +0800 Subject: [PATCH] Fix disqus_config --- source/js/third-party/comments/disqus.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/js/third-party/comments/disqus.js b/source/js/third-party/comments/disqus.js index 3410b41..381c26f 100644 --- a/source/js/third-party/comments/disqus.js +++ b/source/js/third-party/comments/disqus.js @@ -14,7 +14,9 @@ document.addEventListener('page:loaded', () => { } if (CONFIG.page.comments) { - const disqus_config = function() { + // `disqus_config` should be a global variable + // See https://help.disqus.com/en/articles/1717084-javascript-configuration-variables + window.disqus_config = function() { this.page.url = CONFIG.page.permalink; this.page.identifier = CONFIG.page.path; this.page.title = CONFIG.page.title; @@ -26,7 +28,7 @@ document.addEventListener('page:loaded', () => { if (window.DISQUS) { DISQUS.reset({ reload: true, - config: disqus_config + config: window.disqus_config }); } else { NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/embed.js`, {