diff options
author | John Hollowell <johnahollowell@gmail.com> | 2020-05-07 03:15:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 03:15:43 +0300 |
commit | 64c2076517d68e25afafbed2019891b7976c9d1d (patch) | |
tree | ef94c79f84978b147e5f15efc9e783d7f4ccaebe | |
parent | ed8061d858b8d3c514eacbe2e5cb222124ba0755 (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)
-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"> |