Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/docsy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Chalin <chalin@users.noreply.github.com>2022-08-11 15:02:10 +0300
committerGitHub <noreply@github.com>2022-08-11 15:02:10 +0300
commitf8e4409b497a6a5caef969c770c354917adcfd9d (patch)
tree10b006c83f99d37d516e2f9ceeeea95854747789
parent2b3b9247cf70afb4e40e3fbe1fc6fc46632715c6 (diff)
Display non-empty page TOC (#1147)
-rw-r--r--layouts/partials/toc.html16
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 -}}