Skip to content

Commit

Permalink
Revert b95dffa by re-adding h1 headline detection in content partial.
Browse files Browse the repository at this point in the history
  • Loading branch information
SupImDos committed Feb 16, 2023
1 parent 9653719 commit a7fbd90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions material/partials/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 2 additions & 3 deletions src/partials/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down

0 comments on commit a7fbd90

Please sign in to comment.