diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 3d148a2..588d180 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,8 +1,12 @@ {{ $toc := true }} -{{ if isset .Site.Params "toc" }} - {{ $toc = .Site.Params.toc }} +{{ if isset .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 }} -{{ $toc = and ($toc) (ge .WordCount .Site.Params.tocWordCount) }} {{ if $toc }}