From 970c49bd06d6631442a021731156ec51198060f1 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sat, 20 Jan 2024 13:47:36 +0800 Subject: [PATCH] [opt] recent --- layout/_partial/widgets/recent.ejs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layout/_partial/widgets/recent.ejs b/layout/_partial/widgets/recent.ejs index 502b898..fe3bf5e 100644 --- a/layout/_partial/widgets/recent.ejs +++ b/layout/_partial/widgets/recent.ejs @@ -25,7 +25,8 @@ function layoutDiv() { arr = site.posts.filter( p => p.title && p.title.length > 0) arr = arr.sort("updated", -1) } - el += '
'; + el += '
' + arr = arr.filter(p => p.title?.length > 0) arr.length = item.limit arr.forEach(post => { if (!post) { return } @@ -39,7 +40,7 @@ function layoutDiv() { el += '' + name + '' + ''; } } - el += (post.title || post.wiki) + ''; + el += post.title + ''; if (isActive) { el += icon('default:bookmark.active') }