From 154e559b13f87cd220fa3dfdca3ab5a3c072a61d Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 7 Apr 2025 15:35:28 +0800 Subject: feat: latest card section in index page Former-commit-id: fb7259d515305b6e4b5262d132ef06b31300c8db --- layouts/index.html | 96 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 66 insertions(+), 30 deletions(-) (limited to 'layouts') diff --git a/layouts/index.html b/layouts/index.html index 99323bee..3a7a29ba 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,41 +1,77 @@ {{ define "main" }} -
+
{{ partial "header.html" . }} {{ partial "components/postnav.html" . }} -
- {{ $firstPost := true }} - {{ range first 8 (where site.RegularPages "Type" "in" site.Params.mainSections) }} -
-
-
- - - {{ .Title }} + + +
+
+ {{ $firstPost := true }} + {{ range first 8 (where site.RegularPages "Type" "in" site.Params.mainSections) }} +
+
+
+ + + {{ .Title }} + +
+ {{ with .Params.categories }} + + {{ end }} +
+ + {{ if $firstPost }} +
+ {{ .Summary }} +
+ {{ $firstPost = false }} + {{ end }} +
+ {{ end }} +
+ 查看所有 +
+ + {{ if eq .Site.Language.Lang "zh" }} + +
+

{{ T "cards" }}

+
+ {{- $cards := .Site.GetPage "section" "cards" }} + {{- $paginator := .Paginate $cards.Pages 4 }} + {{- range $paginator.Pages }} +
+
+

+ {{ .Title }}

+ {{- if .Params.tags }} +

+ {{- range .Params.tags }} + #{{ . }} + {{- end }} +

+ {{- end }}
- {{ with .Params.categories }} - - {{ end }} -
- - {{ if $firstPost }} -
+ +
{{ .Summary }}
- {{ $firstPost = false }} - {{ end }} +
+ {{- end }}
- {{ end }} -
- 查看所有 + + {{ end }}
{{ partial "footer.html" . }} {{ end }} -- cgit v1.2.3