Improves ToC logic to account for both site and page configuration
This commit is contained in:
parent
7484d058f2
commit
8c4d7defca
@ -1,8 +1,12 @@
|
|||||||
{{ $toc := true }}
|
{{ $toc := true }}
|
||||||
{{ if isset .Site.Params "toc" }}
|
{{ if isset .Params "toc" }}
|
||||||
{{ $toc = .Site.Params.toc }}
|
{{ $toc = .Params.toc }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $toc = ge .WordCount .Site.Params.tocWordCount }}
|
||||||
|
{{ if and (isset .Site.Params "toc") (not (.Site.Params.toc)) }}
|
||||||
|
{{ $toc = false }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $toc = and ($toc) (ge .WordCount .Site.Params.tocWordCount) }}
|
|
||||||
|
|
||||||
|
|
||||||
{{ if $toc }}
|
{{ if $toc }}
|
||||||
|
Loading…
Reference in New Issue
Block a user