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

26 lines
579 B
Plaintext

<%
function layoutDiv() {
var el = '';
const cmt = page.cmt;
if (cmt?.service?.length > 0) {
const name = cmt.service;
var body = cmt[name];
if (theme.style.prefers_theme != 'auto' && body['data-theme'] == 'preferred_color_scheme') {
body['data-theme'] = theme.style.prefers_theme
}
el += '<div id="' + name + '"';
for (let key of Object.keys(body)) {
if (body[key] !== null) {
el += ' ' + key + '="' + body[key] + '"';
}
}
el += '></div>';
}
return el;
}
%>
<%- icon('default:loading') %>
<%- layoutDiv() %>