summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-09-10 00:38:35 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-09-10 00:38:35 +0800
commitce9554ceaa68e3a1469ece2b0f303bb7c98d1550 (patch)
tree6e9184d45b3978515d02c2f65f5c17d0aa31c010 /layouts
parent073191903c305db0c977b8d3e01b96c80805ab3e (diff)
Support nested note series
Diffstat (limited to 'layouts')
-rw-r--r--layouts/notes/list.html41
1 files changed, 30 insertions, 11 deletions
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 -}}
<article lang="{{ default "en" .Params.lang }}">
<header class="document-header">
<h1>{{ .Title }}</h1>
{{ partial "document-view.html" . }}
</header>
{{ .Content }}
- {{- if eq .File.Path "notes/_index.md" }}
+ {{- if $isNotesRoot }}
{{- with .RegularPages.ByTitle }}
<section aria-labelledby="standalone-title">
<h2 id="standalone-title">STANDALONE NOTES</h2>
@@ -16,7 +17,7 @@
</ul>
</section>
{{- end }}
- {{- with .Sections.ByTitle }}
+ {{- with .Sections.ByWeight }}
<section aria-labelledby="series-title">
<h2 id="series-title">SERIES</h2>
<ul class="document-list">
@@ -27,15 +28,33 @@
</section>
{{- end }}
{{- else }}
- <ol class="document-list series-chapter-list">
- {{- range $index, $page := .RegularPages.ByWeight }}
- <li>
- <span class="chapter-number">{{ printf "%02d" (add $index 1) }}</span>
- <a href="{{ $page.RelPermalink }}" lang="{{ $page.Params.lang }}">{{ $page.LinkTitle }}</a>
- <span class="list-updated">updated {{ time.Format "2006-01-02" $page.Params.updated }}</span>
- </li>
- {{- end }}
- </ol>
+ {{- with .RegularPages.ByWeight }}
+ <section aria-labelledby="series-articles-title">
+ <h2 id="series-articles-title">ARTICLES</h2>
+ <ol class="document-list series-chapter-list">
+ {{- range $index, $page := . }}
+ <li>
+ <span class="chapter-number">{{ printf "%02d" (add $index 1) }}</span>
+ <a href="{{ $page.RelPermalink }}" lang="{{ $page.Params.lang }}">{{ $page.LinkTitle }}</a>
+ <span class="list-updated">updated {{ time.Format "2006-01-02" $page.Params.updated }}</span>
+ </li>
+ {{- end }}
+ </ol>
+ </section>
+ {{- end }}
+ {{- with .Sections.ByWeight }}
+ <section aria-labelledby="subseries-title">
+ <h2 id="subseries-title">SUBSERIES</h2>
+ <ol class="document-list series-chapter-list">
+ {{- range $index, $series := . }}
+ <li>
+ <span class="chapter-number">{{ printf "%02d" (add $index 1) }}</span>
+ <a href="{{ $series.RelPermalink }}" lang="{{ $series.Params.lang }}">{{ $series.LinkTitle }}/</a>{{ with $series.Params.description }} — {{ . }}{{ end }}
+ </li>
+ {{- end }}
+ </ol>
+ </section>
+ {{- end }}
{{- end }}
</article>
{{ end }}