#52, Allow to set max showed levels of ToC. e.g. BookToC=3
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
{{ define "book-section" }}
|
||||
{{ with .Section }}
|
||||
<li {{ if .Params.bookFlatSection}} class="book-section-flat" {{ end }}>
|
||||
<li {{ if .Params.BookFlatSection}} class="book-section-flat" {{ end }}>
|
||||
{{ if .Content }}
|
||||
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
|
||||
{{ else }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<nav role="navigation">
|
||||
<nav>
|
||||
{{ partial "docs/brand" . }}
|
||||
{{ partial "docs/inject/menu-before" . }}
|
||||
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user