From 4d75c7568d7061ff5ee8667ee20b448ab13cd89b Mon Sep 17 00:00:00 2001
From: one <onewesh@gmail.com>
Date: Mon, 13 Apr 2020 12:46:53 +0000
Subject: [PATCH] Merge pull request #4 from romanc/feature/noEmptyTocInSidebar

---
 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 }}

--
Gitblit v1.10.0