hexo-theme-stellar/layout/_partial/widgets/markdown.ejs

24 lines
598 B
Plaintext
Raw Normal View History

2021-11-19 20:25:39 +08:00
<%
function layoutDiv() {
2024-01-11 23:39:36 +08:00
if (!item.content?.length && !item.src?.length) return ''
2021-11-19 20:25:39 +08:00
var el = '';
2022-11-23 21:54:21 +08:00
el += '<widget class="widget-wrapper markdown">';
2022-11-22 22:38:01 +08:00
if (item.title?.length > 0) {
2024-01-17 22:57:52 +08:00
el += '<div class="widget-header dis-select">';
2022-11-22 22:38:01 +08:00
el += '<span class="name">' + item.title + '</span>';
2021-11-19 20:25:39 +08:00
el += '</div>';
2022-11-22 22:38:01 +08:00
}
el += '<div class="widget-body fs14">';
2024-01-11 23:39:36 +08:00
if (item.content) {
el += markdown(item.content);
}
if (item.src) {
el += `<div class="stellar-marked-api md-marked" src="${item.src}"></div>`
}
2022-11-22 22:38:01 +08:00
el += '</div>';
2022-11-23 21:54:21 +08:00
el += '</widget>';
2021-11-19 20:25:39 +08:00
return el;
}
%>
<%- layoutDiv() %>