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

30 lines
1.0 KiB
Plaintext
Raw Normal View History

2021-02-21 23:20:13 +08:00
<%
function layoutDiv() {
var el = '';
el += '<div id="utterances"';
let utterances = Object.assign({}, theme.comments.utterances, page.utterances);
if (page.comment_id) {
utterances['issue-term'] = page.comment_id;
}
if (page.dark && utterances.theme.dark) {
utterances.theme = utterances.theme.dark;
} else if (utterances.theme.light) {
utterances.theme = utterances.theme.light;
}
2021-02-22 22:03:02 +08:00
if (utterances['issue-number']) {
utterances['issue-term'] = null;
}
2021-02-21 23:20:13 +08:00
for (let key of Object.keys(utterances)) {
if (utterances[key]) {
el += ' ' + key + '="' + utterances[key] + '"';
}
}
el += '></div>';
return el;
}
%>
2021-02-23 21:09:49 +08:00
<svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg>
2021-02-21 23:20:13 +08:00
<%- layoutDiv() %>