aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/toc.html
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2019-05-27 16:48:23 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2019-05-27 16:48:23 +0200
commite452a7bedabdfe0c0d62aa4e948902d6632a889d (patch)
treeea638449f93fb820ce3c3df0c6a3ee780edf7d61 /layouts/partials/docs/toc.html
parent6d64cc708e73c38f23bfc5929608d5d77a9c5a07 (diff)
#52, Allow to set max showed levels of ToC. e.g. BookToC=3
Diffstat (limited to 'layouts/partials/docs/toc.html')
-rw-r--r--layouts/partials/docs/toc.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/docs/toc.html b/layouts/partials/docs/toc.html
index 83c276d..c81341c 100644
--- a/layouts/partials/docs/toc.html
+++ b/layouts/partials/docs/toc.html
@@ -1,6 +1,6 @@
-{{ $showToC := default (default true .Site.Params.BookShowToC) .Params.bookshowtoc }}
- {{ if and ($showToC) (.Page.TableOfContents) }}
- <aside class="book-toc fixed">
+{{ $tocLevels := default (default 6 .Site.Params.BookToC) .Params.BookToC }}
+{{ if and $tocLevels .Page.TableOfContents }}
+ <aside class="book-toc level-{{$tocLevels}} fixed">
{{ .Page.TableOfContents }}
</aside>
{{ end }}