mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-22 11:29:28 +00:00
e037b7c70f
* Implement TOC for mobile * Uses Page title as label * Label entries so that tapping TOC will hide menu * Switch to medium breakpoint * Correct tos -> toc * toc-menu-control -> toc-control
11 lines
322 B
HTML
11 lines
322 B
HTML
{{ $tocLevels := default (default 6 .Site.Params.BookToC) .Params.BookToC }}
|
|
{{ if and $tocLevels .Page.TableOfContents }}
|
|
<aside class="book-toc levels-{{$tocLevels}} fixed">
|
|
{{ with .Page.TableOfContents }}
|
|
<label id="toc-control" for="toc-control">
|
|
{{ . }}
|
|
</label>
|
|
{{ end }}
|
|
</aside>
|
|
{{ end }}
|