aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/recent-posts.html
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-06-06 12:15:18 +0800
committerverdant <im@verdant.ee>2026-06-06 12:15:18 +0800
commit35ebc07f987bb4f732e9a09997e28f39b1fd705e (patch)
tree1c5e2584f715062eca1caba53e77dd13d88282be /layouts/shortcodes/recent-posts.html
parent25ea0cacc111877d55a39c8c089db91cfee340aa (diff)
downloadblog-35ebc07f987bb4f732e9a09997e28f39b1fd705e.tar.gz
blog-35ebc07f987bb4f732e9a09997e28f39b1fd705e.zip
Make it look better
Diffstat (limited to 'layouts/shortcodes/recent-posts.html')
-rw-r--r--layouts/shortcodes/recent-posts.html39
1 files changed, 21 insertions, 18 deletions
diff --git a/layouts/shortcodes/recent-posts.html b/layouts/shortcodes/recent-posts.html
index 45e1958..9819f36 100644
--- a/layouts/shortcodes/recent-posts.html
+++ b/layouts/shortcodes/recent-posts.html
@@ -3,23 +3,26 @@
{{ $recent := first 10 $pages.ByDate.Reverse }}
<div class="recent-posts">
- {{ if $recent }}
- <ul class="posts-list {{ if eq $mode 1 }}with-summary{{ else }}title-only{{ end }}">
- {{ range $recent }}
- <li>
- <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>
-
- <span class="post-link-wrapper">
- <a href="{{ .RelPermalink }}" class="post-title">{{ .Title }}</a>
- </span>
+ {{ if $recent }}
+ <ul class="posts-list {{ if eq $mode 1 }}with-summary{{ else }}title-only{{ end }}">
- {{ if eq $mode 1 }}
- <p class="post-summary">{{ .Summary | plainify | truncate 150 }}</p>
- {{ end }}
- </li>
- {{ end }}
- </ul>
- {{ else }}
- <p class="posts-empty">暂无随笔 / No posts found.</p>
- {{ end }}
+ {{ range $recent }}
+ <li>
+ <span class="post-link-wrapper">
+ <a href="{{ .RelPermalink }}" class="post-title">{{ .Title }}</a>
+ </span>
+
+ <time datetime="{{ .Date.Format " 2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>
+
+ {{ if eq $mode 1 }}
+ <p class="post-summary">{{ .Summary | plainify | truncate 150 }}</p>
+ {{ end }}
+ </li>
+ {{ end }}
+
+
+ </ul>
+ {{ else }}
+ <p class="posts-empty">暂无随笔 / No posts found.</p>
+ {{ end }}
</div>