diff --git a/material/partials/content.html b/material/partials/content.html
index ff9eedfa0..d756b647e 100644
--- a/material/partials/content.html
+++ b/material/partials/content.html
@@ -5,7 +5,8 @@
{% include "partials/tags.html" %}
{% endif %}
{% include "partials/actions.html" %}
-{% if "\x3ch1" not in page.content %}
+{% set first = page.toc | first %}
+{% if first and first.level != 1 %}
{{ page.title | d(config.site_name, true)}}
{% endif %}
{{ page.content }}
diff --git a/src/partials/content.html b/src/partials/content.html
index 6ec8b42d9..6930a1ed1 100644
--- a/src/partials/content.html
+++ b/src/partials/content.html
@@ -29,10 +29,11 @@
{% include "partials/actions.html" %}
-{% if "\x3ch1" not in page.content %}
+{% set first = page.toc | first %}
+{% if first and first.level != 1 %}
{{ page.title | d(config.site_name, true)}}
{% endif %}
diff --git a/src/partials/toc.html b/src/partials/toc.html
index de8c7b146..cb50b257b 100644
--- a/src/partials/toc.html
+++ b/src/partials/toc.html
@@ -31,7 +31,7 @@
{% set toc = page.toc %}