mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
Fix disqus_config
This commit is contained in:
parent
baf5e02b74
commit
4c2828d289
6
source/js/third-party/comments/disqus.js
vendored
6
source/js/third-party/comments/disqus.js
vendored
@ -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`, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user