<% function layoutDiv() { const cmt = 'utterances'; // 合并配置参数 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 = ''; el += '
<%- layoutDiv() %>