diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 110c245..57f9ad3 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -16,11 +16,13 @@
{{- end }}
+{{- if .Content }}
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
+{{- end }}
{{- $pages := union .RegularPages .Sections }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 8a85fc8..8d42cd7 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -25,11 +25,15 @@
{{- if (.Param "ShowToc") }}
{{- partial "toc.html" . }}
{{- end }}
+
+ {{- if .Content }}
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
+ {{- end }}
+