about summary refs log tree commit diff
path: root/layouts/partials/toc.html
diff options
context:
space:
mode:
authorNgô Ngọc Đức Huy <huyngo@disroot.org>2023-07-31 08:43:42 +0700
committerNgô Ngọc Đức Huy <huyngo@disroot.org>2023-07-31 08:43:42 +0700
commit000d2655efb7839a6b626fae82bf310bd4b4ab74 (patch)
tree26b6720ff507b4a29816c13cc50942a084812e99 /layouts/partials/toc.html
parente75b69fd48bc953f6dfe2c65c1f70798da3b8adc (diff)
downloadvictor-000d2655efb7839a6b626fae82bf310bd4b4ab74.tar.gz
Add book section recursion
Diffstat (limited to 'layouts/partials/toc.html')
-rw-r--r--layouts/partials/toc.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
new file mode 100644
index 0000000..f6af753
--- /dev/null
+++ b/layouts/partials/toc.html
@@ -0,0 +1,15 @@
+{{ $chapters := .Page.Pages }}
+{{ range .Page.Translations }}
+{{ $chapters = $chapters | lang.Merge .Pages }}
+{{ end}}
+<ol>
+  {{ range sort $chapters "Weight" }}
+  <li>
+    <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a>
+    {{ partial "post-info.html" . }}
+    {{ if .IsSection}}
+      {{ partial "toc.html" . }}
+    {{ end }}
+  </li>
+  {{ end }}
+</ol>