diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index 2656c6d..3d148a2 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -1,9 +1,8 @@
-{{ $toc := and ($.Site.Params.toc) (ge .WordCount $.Site.Params.tocWordCount) }}
-{{ if isset .Params "toc" }}
- {{ $toc = .Params.toc }}
-{{ else }}
- {{ $toc = true }}
+{{ $toc := true }}
+{{ if isset .Site.Params "toc" }}
+ {{ $toc = .Site.Params.toc }}
{{ end }}
+{{ $toc = and ($toc) (ge .WordCount .Site.Params.tocWordCount) }}
{{ if $toc }}