Revert b95dffa by re-adding h1 headline detection in content partial.

This commit is contained in:
SupImDos 2023-02-16 19:38:35 +08:00
parent 9653719524
commit a7fbd90fe8
2 changed files with 3 additions and 5 deletions

View File

@ -5,8 +5,7 @@
{% include "partials/tags.html" %}
{% endif %}
{% include "partials/actions.html" %}
{% set first = page.toc | first %}
{% if first and first.level != 1 %}
{% if "\x3ch1" not in page.content %}
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}
{{ page.content }}

View File

@ -29,11 +29,10 @@
{% include "partials/actions.html" %}
<!--
Check whether the content starts with a level 1 headline. If it doesn't, the
Hack: check whether the content contains a h1 headline. If it doesn't, the
page title (or respectively site name) is used as the main headline.
-->
{% set first = page.toc | first %}
{% if first and first.level != 1 %}
{% if "\x3ch1" not in page.content %}
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}