diff options
author | romanc <romanc@user.noreply.github.com> | 2020-04-13 00:55:45 +0300 |
---|---|---|
committer | romanc <romanc@user.nopreply.github.com> | 2020-04-13 01:01:19 +0300 |
commit | e5f3ae6d8e0365772efee7ee06db980cc7126b5c (patch) | |
tree | addef4340961fb340cb28b15880e10954256743d /layouts | |
parent | bc3989e1fdb02665365adae579b13562ae83ec92 (diff) |
only print toc if non-empty
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/sidebar.html | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 6030409..6af5f1a 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -12,7 +12,9 @@ {{- range . }} {{- if .IsPage }} <h3 class="section_link{{ if eq .RelPermalink $permalink }} active{{ end }}"><a id="docs-{{ anchorize .Title }}" href="{{ .Permalink }}">{{ .Title }}</a></h3> - {{- .TableOfContents }} + {{- if ne (print .TableOfContents) ""}} + {{- .TableOfContents }} + {{- end }} {{- else }} {{- template "tree" (dict "page" $page "section" .) }} {{- end }} |