From fc90c761597e201dc1688dec2a3499cf5c72397b Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Wed, 1 Dec 2021 12:27:52 +0800 Subject: [PATCH] Fix multiple h1 tag (#416) --- layout/_macro/post.njk | 6 +++--- layout/_partials/header/brand.njk | 2 +- layout/_partials/header/index.njk | 2 +- layout/_partials/header/menu.njk | 2 +- layout/_partials/sidebar/site-overview.njk | 8 ++++---- layout/category.njk | 4 ++-- layout/index.njk | 2 +- layout/page.njk | 2 +- layout/tag.njk | 4 ++-- source/css/_common/outline/header/site-meta.styl | 1 + 10 files changed, 17 insertions(+), 16 deletions(-) diff --git a/layout/_macro/post.njk b/layout/_macro/post.njk index 8d4b708..772dfba 100644 --- a/layout/_macro/post.njk +++ b/layout/_macro/post.njk @@ -20,7 +20,7 @@ {%- if post.header !== false %}
- <{%- if is_index %}h2{% else %}h1{%- endif %} class="post-title{%- if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}" itemprop="name headline"> + <{% if is_index %}h2{% else %}h1{% endif %} class="post-title{% if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="name headline"> {# Link posts #} {%- if post.link %} {%- if post.sticky > 0 %} @@ -42,7 +42,7 @@ {{- post.title }} {{- post_edit(post.source) }} {%- endif %} - +
{{ partial('_partials/post/post-meta.njk') }} @@ -57,7 +57,7 @@ {#################} {### POST BODY ###} {#################} -
+
{%- if is_index %} {%- if post.description and theme.excerpt_description %}

{{ post.description }}

diff --git a/layout/_partials/header/brand.njk b/layout/_partials/header/brand.njk index ff0d296..9299960 100644 --- a/layout/_partials/header/brand.njk +++ b/layout/_partials/header/brand.njk @@ -16,7 +16,7 @@ -

{{ title }}

+ <{% if is_home() or is_archive() %}h1{% else %}p{% endif %} class="site-title">{{ title }}
{%- if subtitle %} diff --git a/layout/_partials/header/index.njk b/layout/_partials/header/index.njk index 69a40c2..37c4c10 100644 --- a/layout/_partials/header/index.njk +++ b/layout/_partials/header/index.njk @@ -1,4 +1,4 @@ -{{ partial('_partials/header/brand.njk', {}, {cache: theme.cache.enable}) }} +{{ partial('_partials/header/brand.njk') }} {{ partial('_partials/header/menu.njk', {}, {cache: theme.cache.enable}) }} diff --git a/layout/_partials/header/menu.njk b/layout/_partials/header/menu.njk index 5b39769..d1dc8a5 100644 --- a/layout/_partials/header/menu.njk +++ b/layout/_partials/header/menu.njk @@ -25,7 +25,7 @@ {%- if theme.algolia_search.enable or theme.local_search.enable %} {%- endif %} diff --git a/layout/_partials/sidebar/site-overview.njk b/layout/_partials/sidebar/site-overview.njk index 8f3de41..857c4c6 100644 --- a/layout/_partials/sidebar/site-overview.njk +++ b/layout/_partials/sidebar/site-overview.njk @@ -30,7 +30,7 @@ {%- endif %} {{ site.categories.length }} {{ __('state.categories') }} - {%- if hasCategoriesPage %}{%- endif %} + {%- if hasCategoriesPage %}{% endif %}
{%- endif %} @@ -44,7 +44,7 @@ {%- endif %} {{ site.tags.length }} {{ __('state.tags') }} - {%- if hasTagsPage %}{%- endif %} + {%- if hasTagsPage %}{% endif %}
{%- endif %} @@ -54,7 +54,7 @@ {%- if theme.chat.enable and (theme.chatra.enable or theme.tidio.enable or theme.gitter.enable) %} @@ -84,7 +84,7 @@ {%- if theme.links %}