From 4802a50ca8ac768171f5e893dedadf81a215a95d Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 27 Mar 2025 14:26:26 +0800 Subject: feat: group library books by year Former-commit-id: 7c4120af196f04e320a62c6102ef1e621c4a0538 --- assets/css/components/_library.scss | 2 +- layouts/library/section.html | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/assets/css/components/_library.scss b/assets/css/components/_library.scss index 5179076f..40135ce8 100644 --- a/assets/css/components/_library.scss +++ b/assets/css/components/_library.scss @@ -1,5 +1,5 @@ #library { - #library-content { + .book-group { --gap: 1rem; display: flex; align-items: center; diff --git a/layouts/library/section.html b/layouts/library/section.html index bc55b500..7d824879 100644 --- a/layouts/library/section.html +++ b/layouts/library/section.html @@ -2,13 +2,20 @@ {{ partial "header.html" . }}
- {{- range .Pages }} -
- - - -
- {{- end }} + {{ range .Pages.GroupByDate "2006" }} +

{{ .Key }}

+
+ {{ range .Pages }} +
+ + + +
+ {{ end }} +
+ {{ end }} +

关于 2024 年的更多书目,请阅读《IN LIBRIS LIBERTAS》

{{ end }} -- cgit v1.2.3