mobile toc menu (#121)

* 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
This commit is contained in:
tyler71
2020-01-13 08:44:24 -08:00
committed by Alex Shpak
parent d6290dcf50
commit e037b7c70f
5 changed files with 29 additions and 16 deletions
+5 -1
View File
@@ -1,6 +1,10 @@
{{ $tocLevels := default (default 6 .Site.Params.BookToC) .Params.BookToC }}
{{ if and $tocLevels .Page.TableOfContents }}
<aside class="book-toc levels-{{$tocLevels}} fixed">
{{ .Page.TableOfContents }}
{{ with .Page.TableOfContents }}
<label id="toc-control" for="toc-control">
{{ . }}
</label>
{{ end }}
</aside>
{{ end }}