From e301eb585a6b4e8d66985a1bf885b6ca4d59469d Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Thu, 11 Jan 2024 23:39:36 +0800 Subject: [PATCH] [feat] sidebar widget: markdown.src --- layout/_partial/widgets/markdown.ejs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/layout/_partial/widgets/markdown.ejs b/layout/_partial/widgets/markdown.ejs index a243468..6241f89 100644 --- a/layout/_partial/widgets/markdown.ejs +++ b/layout/_partial/widgets/markdown.ejs @@ -1,6 +1,6 @@ <% function layoutDiv() { - if (!item.content?.length) return '' + if (!item.content?.length && !item.src?.length) return '' var el = ''; el += ''; if (item.title?.length > 0) { @@ -9,7 +9,12 @@ function layoutDiv() { el += ''; } el += '
'; - el += markdown(item.content); + if (item.content) { + el += markdown(item.content); + } + if (item.src) { + el += `
` + } el += '
'; el += '
'; return el;