diff options
author | Patrice Chalin <chalin@users.noreply.github.com> | 2022-08-11 15:02:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 15:02:10 +0300 |
commit | f8e4409b497a6a5caef969c770c354917adcfd9d (patch) | |
tree | 10b006c83f99d37d516e2f9ceeeea95854747789 | |
parent | 2b3b9247cf70afb4e40e3fbe1fc6fc46632715c6 (diff) |
Display non-empty page TOC (#1147)
-rw-r--r-- | layouts/partials/toc.html | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index fa5c69b..36185b7 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,7 +1,9 @@ -{{ if not .Params.notoc }} -{{ with .TableOfContents }} -{{ if ge (len .) 200 }} -<div class="td-toc">{{ . }}</div> -{{ end }} -{{ end }} -{{ end }}
\ No newline at end of file +{{ if not .Params.notoc -}} + {{ with .TableOfContents -}} + {{ if ne . `<nav id="TableOfContents"></nav>` -}} + <div class="td-toc"> + {{ . }} + </div> + {{ end -}} + {{ end -}} +{{ end -}} |