diff options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/shortcodes/recent-posts.html | 39 |
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> |
