hexo-theme-stellar/layout/_partial/plugins/comments/layout.ejs

33 lines
1.0 KiB
Plaintext
Raw Normal View History

2021-02-19 23:33:19 +08:00
<%
var loadComment = false;
if (theme.comments.service && theme.comments.service.length > 0) {
if (page.comments == undefined || page.comments != false) {
loadComment = true;
}
}
// 合并项目评论
2021-07-13 23:45:34 +08:00
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;
2021-02-19 23:33:19 +08:00
}
}
}
%>
<% if (loadComment) { %>
2021-07-13 22:25:24 +08:00
<div class='related-wrap md reveal' id="comments">
2021-02-28 18:19:32 +08:00
<div class='cmt-title cap theme'>
2021-07-13 23:45:34 +08:00
<%- page.comment_title !== undefined ? markdown(page.comment_title) : __('meta.comment_title') %>
2021-02-19 23:33:19 +08:00
</div>
<div class='cmt-body <%- theme.comments.service %>'>
<%- partial(theme.comments.service + '/layout') %>
</div>
2021-02-25 20:49:43 +08:00
</div>
2021-02-19 23:33:19 +08:00
<% } %>