diff --git a/layout/_partial/plugins/comments/layout.ejs b/layout/_partial/plugins/comments/layout.ejs index ad4725c..4806905 100644 --- a/layout/_partial/plugins/comments/layout.ejs +++ b/layout/_partial/plugins/comments/layout.ejs @@ -6,11 +6,16 @@ if (theme.comments.service && theme.comments.service.length > 0) { } } // 合并项目评论 -if (loadComment && page.layout == 'wiki' && page.wiki) { - if (page.comment_id == undefined) { - if (theme.comments.service == 'utterances') { - // 使用项目名作为评论issue标题并共享评论数据 - page.comment_id = page.wiki; +if (loadComment && page.layout === 'wiki' && page.wiki) { + let proj = theme.wiki.projects[page.wiki]; + if (proj.comment_id !== undefined && page.comment_id === undefined) { + if (theme.comments.service === 'utterances') { + page.comment_id = proj.comment_id; + } + } + if (proj.comment_title !== undefined && page.comment_title === undefined) { + if (theme.comments.service === 'utterances') { + page.comment_title = proj.comment_title; } } } @@ -18,7 +23,7 @@ if (loadComment && page.layout == 'wiki' && page.wiki) { <% if (loadComment) { %>