From c9b656d4375737c259f96b944c87e3a988c4a935 Mon Sep 17 00:00:00 2001 From: verdant Date: Sun, 24 May 2026 21:00:28 +0800 Subject: Tweak some layouts for index --- layouts/shortcodes/recent-posts.html | 154 +++++++++++++++++++++++------------ 1 file changed, 100 insertions(+), 54 deletions(-) (limited to 'layouts') diff --git a/layouts/shortcodes/recent-posts.html b/layouts/shortcodes/recent-posts.html index 5c209f1..e720d33 100644 --- a/layouts/shortcodes/recent-posts.html +++ b/layouts/shortcodes/recent-posts.html @@ -1,67 +1,113 @@ + +{{ $mode := 2 }} + {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} -{{ $recent := first 10 $pages.ByDate.Reverse }} +{{ $recent := first 20 $pages.ByDate.Reverse }} + +{{ if eq $mode 1 }} + +
+ {{ if $recent }} + + {{ else }} +
暂无文章
+ {{ end }} +
+{{ end }} + + + +{{ if eq $mode 2 }} + +
- {{ if $recent }} - - {{ else }} -
暂无文章
- {{ end }} + {{ range $recent }} +
+ {{ .Date.Format "2006-01-02" }} + {{ .Title }} +
+
+ {{ end }}
+ + + +{{ end }} -- cgit v1.2.3