From 0bdecf2d39bb2a0a0cdedecd24864b4122e5cb35 Mon Sep 17 00:00:00 2001 From: verdant Date: Wed, 22 Jul 2026 00:03:22 +0800 Subject: Rewrite shortcode recent-posts --- layouts/shortcodes/recent-posts.html | 53 +++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 16 deletions(-) (limited to 'layouts/shortcodes') diff --git a/layouts/shortcodes/recent-posts.html b/layouts/shortcodes/recent-posts.html index 4c3a784..5bd7f3c 100644 --- a/layouts/shortcodes/recent-posts.html +++ b/layouts/shortcodes/recent-posts.html @@ -1,25 +1,46 @@ -{{ $mode := 2 }} + {{ $mode := 2 }} + {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} + {{ $recent := first 15 $pages.ByDate.Reverse }} +
- {{ if $recent }} -
- - {{ .Title }} - - - {{ end }} - - {{ else }} -

暂无随笔 / No posts found.

- {{ end }} - -- cgit v1.2.3