⚡ Use script to control comments container show.
This commit is contained in:
8
assets/js/third-party/comments/giscus.js
vendored
8
assets/js/third-party/comments/giscus.js
vendored
@@ -2,7 +2,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
const element = '.giscus-container';
|
||||
if (!NexT.CONFIG.page.comments
|
||||
|| !NexT.CONFIG.page.giscus
|
||||
|| !NexT.CONFIG.giscus
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const {
|
||||
@@ -14,11 +14,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
reactions,
|
||||
repo,
|
||||
repoid,
|
||||
theme } = NexT.CONFIG.page.giscus.cfg;
|
||||
theme } = NexT.CONFIG.giscus.cfg;
|
||||
|
||||
|
||||
NexT.utils.loadComments(element)
|
||||
.then(() => NexT.utils.getScript(NexT.CONFIG.page.giscus.js, {
|
||||
.then(() => NexT.utils.getScript(NexT.CONFIG.giscus.js, {
|
||||
attributes: {
|
||||
'async' : true,
|
||||
'crossorigin' : 'anonymous',
|
||||
@@ -31,7 +31,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
'data-emit-metadata' : emit ? 1:0,
|
||||
'data-input-position' : inputposition,
|
||||
'data-theme' : theme,
|
||||
'data-lang' : NexT.CONFIG.page.lang,
|
||||
'data-lang' : NexT.CONFIG.lang,
|
||||
'data-loading' : 'lazy'
|
||||
},
|
||||
parentNode: document.querySelector(element)
|
||||
|
||||
Reference in New Issue
Block a user