about summary refs log tree commit diff
path: root/layouts/partials/root-toc.html
diff options
context:
space:
mode:
authorNgô Ngọc Đức Huy <huyngo@disroot.org>2023-08-04 10:17:49 +0700
committerNgô Ngọc Đức Huy <huyngo@disroot.org>2023-08-04 10:19:36 +0700
commitcf91ff39630cead0fad16c16858405b3efbe7994 (patch)
tree3ead000d81c815cdc0fb8403f6a3d7c294cba1eb /layouts/partials/root-toc.html
parent3f8ec96f3436b1b1a1c91807694280cb08fe7ce9 (diff)
downloadvictor-cf91ff39630cead0fad16c16858405b3efbe7994.tar.gz
Implement table of contents
Diffstat (limited to 'layouts/partials/root-toc.html')
-rw-r--r--layouts/partials/root-toc.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/layouts/partials/root-toc.html b/layouts/partials/root-toc.html
new file mode 100644
index 0000000..2792ce9
--- /dev/null
+++ b/layouts/partials/root-toc.html
@@ -0,0 +1,8 @@
+	<details class="toc-collapse">
+		<summary>{{ i18n "toc" }}</summary>
+		{{ $currentLink := .RelPermalink }}
+		{{ range last 1 (where .Ancestors "Params.categories" "intersect" (slice "book") ) }}
+		<a href="{{ .RelPermalink }}">{{ .Title }}</a>
+		{{ partial "toc.html" (dict "content" . "currentLink" $currentLink) }}
+		{{ end }}
+	</details>