aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/_default/list.html
diff options
context:
space:
mode:
authoryingyu5658 <yingyu5658@outlook.com>2025-08-01 21:30:53 +0800
committeryingyu5658 <yingyu5658@outlook.com>2025-08-01 21:30:53 +0800
commit70c5a2b6fb60bd90e7780fa220bfe146141d00e2 (patch)
tree62e4c8e25b1c426c4f6ce21cf25e865445b176d4 /layouts/_default/list.html
downloadhugo-theme-concise-70c5a2b6fb60bd90e7780fa220bfe146141d00e2.tar.gz
hugo-theme-concise-70c5a2b6fb60bd90e7780fa220bfe146141d00e2.zip
Initial commit
Diffstat (limited to 'layouts/_default/list.html')
-rw-r--r--layouts/_default/list.html71
1 files changed, 71 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..f78fbf8
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,71 @@
+{{ define "main" }}
+ <header>{{ partial "header.html" . }}</header>
+ {{ .Content }}
+
+ <!-- 创建分页器对象 -->
+ {{ $paginator := .Paginate .Pages }}
+ {{ range $paginator.Pages }}
+ <div class="post-title">
+ <a class="rel-permalink" href="{{ .RelPermalink }}">
+ <div class="post-date">{{ .PublishDate.Format "2006-01-02" }}</div>
+ {{ .LinkTitle }}
+ </a>
+ <br />
+ </div>
+ {{ end }}
+
+ <!-- 简洁分页导航 -->
+ {{ if gt $paginator.TotalPages 1 }}
+ <div class="pagination simplified-pagination">
+ <nav aria-label="Page navigation">
+ <ul>
+ <!-- 首页按钮 -->
+ <li>
+ {{ if $paginator.HasPrev }}
+ <a href="{{ $paginator.First.URL }}" aria-label="首页">««</a>
+ {{ else }}
+ <span aria-hidden="true" class="disabled">««</span>
+ {{ end }}
+ </li>
+
+ <!-- 上一页按钮 -->
+ <li>
+ {{ if $paginator.HasPrev }}
+ <a href="{{ $paginator.Prev.URL }}" aria-label="上一页">«</a>
+ {{ else }}
+ <span aria-hidden="true" class="disabled">«</span>
+ {{ end }}
+ </li>
+
+ <!-- 当前页/总页数 -->
+ <li class="current-page">
+ <span>{{ $paginator.PageNumber }}/{{ $paginator.TotalPages }}</span>
+ </li>
+
+ <!-- 下一页按钮 -->
+ <li>
+ {{ if $paginator.HasNext }}
+ <a href="{{ $paginator.Next.URL }}" aria-label="下一页">»</a>
+ {{ else }}
+ <span aria-hidden="true" class="disabled">»</span>
+ {{ end }}
+ </li>
+
+ <!-- 末页按钮 -->
+ <li>
+ {{ if $paginator.HasNext }}
+ <a href="{{ $paginator.Last.URL }}" aria-label="末页">»»</a>
+ {{ else }}
+ <span aria-hidden="true" class="disabled">»»</span>
+ {{ end }}
+ </li>
+ </ul>
+ </nav>
+ </div>
+ {{ end }}
+ <footer>
+ {{ partial "footer.html" . }}
+ </footer>
+
+
+{{ end }}