From ce9554ceaa68e3a1469ece2b0f303bb7c98d1550 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Thu, 10 Sep 2026 00:38:35 +0800 Subject: Support nested note series --- layouts/notes/list.html | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'layouts/notes/list.html') diff --git a/layouts/notes/list.html b/layouts/notes/list.html index 86deddb..e45a039 100644 --- a/layouts/notes/list.html +++ b/layouts/notes/list.html @@ -1,11 +1,12 @@ {{ define "main" }} + {{- $isNotesRoot := .Parent.IsHome -}}

{{ .Title }}

{{ partial "document-view.html" . }}
{{ .Content }} - {{- if eq .File.Path "notes/_index.md" }} + {{- if $isNotesRoot }} {{- with .RegularPages.ByTitle }}

STANDALONE NOTES

@@ -16,7 +17,7 @@
{{- end }} - {{- with .Sections.ByTitle }} + {{- with .Sections.ByWeight }}

SERIES

    @@ -27,15 +28,33 @@
{{- end }} {{- else }} -
    - {{- range $index, $page := .RegularPages.ByWeight }} -
  1. - {{ printf "%02d" (add $index 1) }} - {{ $page.LinkTitle }} - updated {{ time.Format "2006-01-02" $page.Params.updated }} -
  2. - {{- end }} -
+ {{- with .RegularPages.ByWeight }} +
+

ARTICLES

+
    + {{- range $index, $page := . }} +
  1. + {{ printf "%02d" (add $index 1) }} + {{ $page.LinkTitle }} + updated {{ time.Format "2006-01-02" $page.Params.updated }} +
  2. + {{- end }} +
+
+ {{- end }} + {{- with .Sections.ByWeight }} +
+

SUBSERIES

+
    + {{- range $index, $series := . }} +
  1. + {{ printf "%02d" (add $index 1) }} + {{ $series.LinkTitle }}/{{ with $series.Params.description }} — {{ . }}{{ end }} +
  2. + {{- end }} +
+
+ {{- end }} {{- end }}
{{ end }} -- cgit v1.2.3