mirror of https://github.com/onweru/compose.git

one
13.46.2020 4d75c7568d7061ff5ee8667ee20b448ab13cd89b
Merge pull request #4 from romanc/feature/noEmptyTocInSidebar

Only print ToC in sidebar if non-empty
1 files modified
4 ■■■ changed files
layouts/partials/sidebar.html 4 ●●● patch | view | raw | blame | history
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 }}