Improve page scripts configuration files.

This commit is contained in:
凡梦星尘
2022-07-22 17:16:34 +08:00
parent a9ff14d312
commit 31f6e21671
15 changed files with 198 additions and 138 deletions

View File

@@ -1,18 +1,18 @@
document.addEventListener('DOMContentLoaded', () => {
const element = '.utterances-container';
if (!NexT.CONFIG.comments.enable
|| !NexT.CONFIG.utterances
if (!NexT.CONFIG.page.comments
|| !NexT.CONFIG.page.utterances
|| !NexT.utils.checkDOMExist(element)) return;
const {
repo,
issueterm,
label,
theme } = NexT.CONFIG.utterances.config;
theme } = NexT.CONFIG.page.utterances.cfg;
NexT.utils.loadComments(element)
.then(() => NexT.utils.getScript(NexT.CONFIG.utterances.js, {
.then(() => NexT.utils.getScript(NexT.CONFIG.page.utterances.js, {
attributes: {
'async' : true,
'crossorigin' : 'anonymous',