diff options
author | John Hollowell <johnahollowell@gmail.com> | 2020-05-07 03:15:43 +0300 |
---|---|---|
committer | Julian <julian@vantage-design.com> | 2020-05-11 15:43:27 +0300 |
commit | c48c0661c99e472963b5de15d3b1f56155ed0df4 (patch) | |
tree | 44653b4384520dd9516027688f9de27cd1dfa128 /layouts | |
parent | 15580bf51b43cb0750b059ef2a78f27b614ce0e4 (diff) |
Allow disabling the TOC
allows using `toc: false` in the frontmatter or config file to disable the table of contents on a per-page or site-wide level (respectively)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 930e486..1b905af 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -12,12 +12,16 @@ {{- partial "menu.html" . -}} </div> + {{- if and (ne .Site.Params.toc false) (ne .Params.toc false) }} <div class="docs-toc large order-lg-2 order-md-0 order-xs-1 col-12 col-lg-2 col-xl-2 position-sticky border-left"> {{- partial "tableofcontents.html" . -}} </div> - <div class="main col-12 order-1 col-md-9 col-lg-10 col-xl-8 py-3"> - {{- block "main" . }}{{- end }} + {{else}} + <div class="main col-12 order-1 col-md-9 col-lg-10 col-xl-10 py-3"> + {{end}} + + {{- block "main" . }}{{- end }} <div class="row"> |