[fix] proj.comments false (#430)

* [fix] proj.comments false

* [fix] page.comments false
This commit is contained in:
星日语 2024-04-10 10:26:26 +08:00 committed by GitHub
parent c40ac638b5
commit 7a5b95f230
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 8 deletions

View File

@ -14,6 +14,10 @@ if (theme.comments.service && theme.comments.service.length > 0) {
// 合并项目评论 // 合并项目评论
const proj = theme.wiki.tree[page.wiki] const proj = theme.wiki.tree[page.wiki]
if (loadComment && (proj != null)) { if (loadComment && (proj != null)) {
if (proj.comments === false) {
loadComment = false;
page.comments = false;
} else {
if (proj.comment_title != undefined && page.comment_title == undefined) { if (proj.comment_title != undefined && page.comment_title == undefined) {
if (['utterances', 'beaudar', 'giscus'].includes(theme.comments.service)) { if (['utterances', 'beaudar', 'giscus'].includes(theme.comments.service)) {
page.comment_title = proj.comment_title; page.comment_title = proj.comment_title;
@ -25,6 +29,7 @@ if (loadComment && (proj != null)) {
cmt[s] = Object.assign({}, theme.comments[s], proj.comments[s]); cmt[s] = Object.assign({}, theme.comments[s], proj.comments[s]);
} }
} }
}
if (cmt.service && page[cmt.service]) { if (cmt.service && page[cmt.service]) {
Object.assign(cmt[cmt.service], page[cmt.service]); Object.assign(cmt[cmt.service], page[cmt.service]);
} }