diff --git a/layout/_partial/plugins/comments/beaudar/layout.ejs b/layout/_partial/plugins/comments/beaudar/layout.ejs index 4b0cbee..48dc222 100644 --- a/layout/_partial/plugins/comments/beaudar/layout.ejs +++ b/layout/_partial/plugins/comments/beaudar/layout.ejs @@ -1,37 +1,18 @@ <% function layoutDiv() { - const cmt = 'beaudar'; - // 合并配置参数 - var config = Object.assign({}, theme.comments[cmt]); - if (page.layout === 'wiki' && page.wiki) { - let proj = theme.wiki.projects[page.wiki]; - if (proj[cmt] != undefined) { - Object.assign(config, proj[cmt]); - } - } - Object.assign(config, page[cmt]); - // 合并评论数据 - if (config['issue-number'] !== null) { - config['issue-term'] = null; - } else { - if (page.comment_id != undefined) { - config['issue-term'] = page.comment_id; - } else if (page.layout === 'wiki' && page.wiki) { - let proj = theme.wiki.projects[page.wiki]; - if (proj.comment_id != undefined) { - config['issue-term'] = proj.comment_id; + var el = ''; + const cmt = page.cmt; + if (cmt && cmt.service && (cmt.service.length > 0)) { + const name = cmt.service; + const body = cmt[name]; + el += '
'; } - // 布局 - var el = ''; - el += ''; return el; } %> diff --git a/layout/_partial/plugins/comments/giscus/layout.ejs b/layout/_partial/plugins/comments/giscus/layout.ejs index 23af6b4..48dc222 100644 --- a/layout/_partial/plugins/comments/giscus/layout.ejs +++ b/layout/_partial/plugins/comments/giscus/layout.ejs @@ -1,35 +1,18 @@ <% function layoutDiv() { - const cmt = 'giscus'; - // 合并配置参数 - var config = Object.assign({}, theme.comments[cmt]); - if (page.layout === 'wiki' && page.wiki) { - let proj = theme.wiki.projects[page.wiki]; - if (proj[cmt] != undefined) { - Object.assign(config, proj[cmt]); - } - } - Object.assign(config, page[cmt]); - // 合并评论数据 - if (page.comment_id != undefined) { - config['data-mapping'] = 'specific'; - config['data-term'] = page.comment_id; - } else if (page.layout === 'wiki' && page.wiki) { - let proj = theme.wiki.projects[page.wiki]; - if (proj.comment_id != undefined) { - config['data-mapping'] = 'specific'; - config['data-term'] = proj.comment_id; - } - } - // 布局 var el = ''; - el += '