diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 02965f9..88a859c 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -22,14 +22,7 @@
{{ .LinkTitle | humanize }}
{{ end }}
- {{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }}
-
- {{end}}
+ {{partial "toc.html" .}}
{{partial "textprocessing.html" . }}
{{partial "footer.html" .}}
diff --git a/layouts/index.html b/layouts/index.html
index 466a05a..ee33d7c 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -13,14 +13,7 @@
{{partial "darkmode.html" .}}
- {{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }}
-
- {{end}}
+ {{partial "toc.html" .}}
{{partial "textprocessing.html" . }}
{{partial "footer.html" .}}
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
new file mode 100644
index 0000000..acda23d
--- /dev/null
+++ b/layouts/partials/toc.html
@@ -0,0 +1,8 @@
+{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false) (gt .WordCount 250)) }}
+
+{{end}}