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

27 lines
691 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 = '';
2024-01-19 01:05:44 +08:00
el += `<widget class="widget-wrapper${scrollreveal(' ')} 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) {
2024-02-18 12:33:28 +08:00
el += `<div class="ds-mdrender" src="${item.src}"></div>`
2024-01-11 23:39:36 +08:00
}
2024-01-19 23:19:25 +08:00
if (item.linklist) {
el += partial('components/linklist', {item: item.linklist})
}
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() %>