From 10431bd8f5ff71690ae4e5444e8d7894fd401ae5 Mon Sep 17 00:00:00 2001 From: eltrac Date: Tue, 7 Apr 2026 14:53:17 +0800 Subject: chore: move templates out of site repo --- layouts/library/section.html | 85 -------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 layouts/library/section.html (limited to 'layouts/library/section.html') diff --git a/layouts/library/section.html b/layouts/library/section.html deleted file mode 100644 index bb297a0d..00000000 --- a/layouts/library/section.html +++ /dev/null @@ -1,85 +0,0 @@ -{{ define "main" }} - -{{ $isLibraryHome := eq .RelPermalink "/library/" }} -{{ $books := .RegularPages }} -{{ if $isLibraryHome }} - {{ $sections := (sort .Sections "value" "asc") }} - {{ range $sections }} - {{ $books = $books | append .RegularPages }} - {{ end }} -{{ end }} - -{{ $years := slice }} -{{ range .Sections }} - {{ $years = $years | append .Title }} -{{ end }} -{{ $years = $years | collections.Reverse }} - -
-
{{ .Content }}
- -
- - {{ if $isLibraryHome }} - {{ partial "components/section-title" (dict - "Left" "最近读的书" - "Right" (printf "共 %d 篇书评" (len $books)) - )}} - {{ end }} - -
- {{ $booksToShow := $books }} - {{ if $isLibraryHome }} - {{ $booksToShow = first 18 $books }} - {{ end }} - {{ range $i, $book := $booksToShow }} -
- {{ partial "items/book" (dict - "ctx" $book - ) }} -
- {{ end }} -
- - - - {{ if $isLibraryHome }} - - -
- - {{ T "library.viewAllThisYear" }} - → - -

- {{ $currentYear := printf "%d" now.Year }} - {{ range $i, $year := $years }} - {{ if ne $year $currentYear }} - {{ $year }} 年 - {{ if not (eq $i (sub (len $years) 1)) }}·{{ end }} - {{ end }} - {{ end }} -

-
- - - {{ $goodBooks := where $books ".Params.rating" "==" 5 }} - {{ partial "components/section-title" (dict - "Left" "推荐好书" - "Right" (printf "共 %d 本" (len $goodBooks)) - )}} -
- {{ range $goodBooks }} - {{ partial "items/book" (dict - "ctx" . - "NoViewTransition" true - ) }} - {{ end }} -
- - {{ end }} - - -
-
-{{ end }} -- cgit v1.2.3