aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/archives-list.html
diff options
context:
space:
mode:
authorverdant <i@glowisle.me>2026-04-11 18:27:20 +0800
committerverdant <i@glowisle.me>2026-04-11 18:27:20 +0800
commit31cd7a3067a9996b7140aeaefb6c97e08db2f78f (patch)
tree752ea978c1e6e1f0dd24cd15d129034a6bb18c34 /layouts/shortcodes/archives-list.html
parent92e642b3d9e2df106e6ad3aa38e4be6966d44268 (diff)
downloadblog-31cd7a3067a9996b7140aeaefb6c97e08db2f78f.tar.gz
blog-31cd7a3067a9996b7140aeaefb6c97e08db2f78f.zip
update
Diffstat (limited to 'layouts/shortcodes/archives-list.html')
-rw-r--r--layouts/shortcodes/archives-list.html57
1 files changed, 31 insertions, 26 deletions
diff --git a/layouts/shortcodes/archives-list.html b/layouts/shortcodes/archives-list.html
index b9767f7..738e368 100644
--- a/layouts/shortcodes/archives-list.html
+++ b/layouts/shortcodes/archives-list.html
@@ -1,30 +1,35 @@
+<header>
+<a href="{{ "" | relURL }}" class="title">
+ <p class="site-title">{{ .Site.Title }}</p>
+</a>
+<nav>{{- partial "nav.html" . -}}</nav>
+
+</header>
+
{{ $allPages := where .Site.RegularPages "Type" "in" (slice "posts" "blog") }}
-{{ $visiblePages := where $allPages "Params.hidden" "!=" true }}
-{{ $pagesToShow := $visiblePages.ByDate.Reverse }}
+{{ $visiblePages := where $allPages "Params.hidden" "!=" true }} {{ $pagesToShow
+:= $visiblePages.ByDate.Reverse }}
<div class="archives-content">
- <h2>归档</h2>
-
- <p>共有 {{ len $pagesToShow }} 篇文章</p>
-
- <ul class="blog-posts">
- {{ $currentYear := 0 }}
- {{ range $pagesToShow }}
- {{ $year := .Date.Year }}
- {{ if ne $year $currentYear }}
- <h3>{{ $year }}</h3>
- {{ $currentYear = $year }}
- {{ end }}
- <li>
- <span>
- <i>
- <time datetime='{{ .Date.Format "2006-01-02" }}'>
- {{ .Date.Format "2006-01-02" }}
- </time>
- </i>
- </span>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- </li>
- {{ end }}
- </ul>
+ <h2>归档</h2>
+
+ <p>共有 {{ len $pagesToShow }} 篇文章</p>
+
+ <ul class="blog-posts">
+ {{ $currentYear := 0 }} {{ range $pagesToShow }} {{ $year := .Date.Year }}
+ {{ if ne $year $currentYear }}
+ <h3>{{ $year }}</h3>
+ {{ $currentYear = $year }} {{ end }}
+ <li>
+ <span>
+ <i>
+ <time datetime='{{ .Date.Format "2006-01-02" }}'>
+ {{ .Date.Format "2006-01-02" }}
+ </time>
+ </i>
+ </span>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
</div>