[feat] sidebar widget: markdown.src

This commit is contained in:
xaoxuu 2024-01-11 23:39:36 +08:00
parent 257225478e
commit e301eb585a
1 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<% <%
function layoutDiv() { function layoutDiv() {
if (!item.content?.length) return '' if (!item.content?.length && !item.src?.length) return ''
var el = ''; var el = '';
el += '<widget class="widget-wrapper markdown">'; el += '<widget class="widget-wrapper markdown">';
if (item.title?.length > 0) { if (item.title?.length > 0) {
@ -9,7 +9,12 @@ function layoutDiv() {
el += '</div>'; el += '</div>';
} }
el += '<div class="widget-body fs14">'; el += '<div class="widget-body fs14">';
if (item.content) {
el += markdown(item.content); el += markdown(item.content);
}
if (item.src) {
el += `<div class="stellar-marked-api md-marked" src="${item.src}"></div>`
}
el += '</div>'; el += '</div>';
el += '</widget>'; el += '</widget>';
return el; return el;