From f78e7c4d70ad4c20163abd1ea8e6ff47cc68fb87 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 15 Jul 2025 10:28:42 +0800 Subject: feat: cancel pagination in card section Former-commit-id: f0853c4bb81eee94060804f387b14d32173c3fdd --- assets/css/components/_card.scss | 14 +++++++++++++- layouts/cards/section.html | 41 ++++++++++++++++++++-------------------- layouts/fictions/section.html | 2 +- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/assets/css/components/_card.scss b/assets/css/components/_card.scss index 8e03cc1d..9b89797e 100644 --- a/assets/css/components/_card.scss +++ b/assets/css/components/_card.scss @@ -78,7 +78,7 @@ } } -.cards-section { +.cards-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; @@ -86,13 +86,25 @@ grid-template-columns: 1fr 1fr; } .card { + font-size: 85%; + line-height: 1.8; margin: 0; h3 { + font-size: 1.2rem; margin: 0; } } } +.cards-list { + display: flex; + gap: 1rem; + flex-wrap: wrap; + justify-content: space-around; + list-style: none; + font-size: 1.2rem; +} + #latest-cards { margin: 1rem 0; .latest-cards-container { diff --git a/layouts/cards/section.html b/layouts/cards/section.html index 4ec8f4ee..89ec474b 100644 --- a/layouts/cards/section.html +++ b/layouts/cards/section.html @@ -1,24 +1,25 @@ {{ define "main" }} -
- {{ partial "header.html" . }} -
- {{- $cards := .Site.GetPage "section" "cards" }} - {{- $paginator := .Paginate $cards.Pages 10 }} - {{- range $paginator.Pages }} - {{ partial "items/card" (dict "context" . "summary" true) }} - {{- end }} -
+
+ {{ partial "header.html" . }} + + {{- $cards := .Site.GetPage "section" "cards" }} + {{- $pages := $cards.Pages }} + {{- $featured := first 6 $pages }} + {{- $rest := after 6 $pages }} +
+ {{- range $featured }} + {{ partial "items/card" (dict "context" . "summary" true) }} + {{- end }} +
+ + - - -
{{ partial "footer.html" . }} +
{{ end }} diff --git a/layouts/fictions/section.html b/layouts/fictions/section.html index f489e3fc..1ce0be54 100644 --- a/layouts/fictions/section.html +++ b/layouts/fictions/section.html @@ -6,7 +6,7 @@ {{ with .Content }}{{ . }}{{ end }}
- {{- $fictions := .Site.GetPage "section" "fictions" }} + {{- $fictions := .Site.GetPage "section" "fictions" }} {{- range $fictions.Pages }}
《{{ .Title }}》 -- cgit v1.2.3