Skip to content

Commit

Permalink
Display non-empty page TOC (#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Aug 11, 2022
1 parent 2b3b924 commit f8e4409
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions layouts/partials/toc.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{ if not .Params.notoc }}
{{ with .TableOfContents }}
{{ if ge (len .) 200 }}
<div class="td-toc">{{ . }}</div>
{{ end }}
{{ end }}
{{ end }}
{{ if not .Params.notoc -}}
{{ with .TableOfContents -}}
{{ if ne . `<nav id="TableOfContents"></nav>` -}}
<div class="td-toc">
{{ . }}
</div>
{{ end -}}
{{ end -}}
{{ end -}}

0 comments on commit f8e4409

Please sign in to comment.