Skip to content

Commit

Permalink
Fix multiple h1 tag (iissnan#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored Dec 1, 2021
1 parent 847fc59 commit fc90c76
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions layout/_macro/post.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

{%- if post.header !== false %}
<header class="post-header">
<{%- 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 %}
Expand All @@ -42,7 +42,7 @@
{{- post.title }}
{{- post_edit(post.source) }}
{%- endif %}
</{%- if is_index %}h2{% else %}h1{%- endif %}>
</{% if is_index %}h2{% else %}h1{% endif %}>

<div class="post-meta-container">
{{ partial('_partials/post/post-meta.njk') }}
Expand All @@ -57,7 +57,7 @@
{#################}
{### POST BODY ###}
{#################}
<div class="post-body{%- if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}" itemprop="articleBody">
<div class="post-body{% if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="articleBody">
{%- if is_index %}
{%- if post.description and theme.excerpt_description %}
<p>{{ post.description }}</p>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/header/brand.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<a href="{{ config.root }}" class="brand" rel="start">
<i class="logo-line"></i>
<h1 class="site-title">{{ title }}</h1>
<{% if is_home() or is_archive() %}h1{% else %}p{% endif %} class="site-title">{{ title }}</{% if is_home() or is_archive() %}h1{% else %}p{% endif %}>
<i class="logo-line"></i>
</a>
{%- if subtitle %}
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/header/index.njk
Original file line number Diff line number Diff line change
@@ -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}) }}

Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/header/menu.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{%- if theme.algolia_search.enable or theme.local_search.enable %}
<li class="menu-item menu-item-search">
<a role="button" class="popup-trigger">
{%- if theme.menu_settings.icons %}<i class="fa fa-search fa-fw"></i>{%- endif %}{{ __('menu.search') }}
{%- if theme.menu_settings.icons %}<i class="fa fa-search fa-fw"></i>{% endif %}{{ __('menu.search') }}
</a>
</li>
{%- endif %}
Expand Down
8 changes: 4 additions & 4 deletions layout/_partials/sidebar/site-overview.njk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{%- endif %}
<span class="site-state-item-count">{{ site.categories.length }}</span>
<span class="site-state-item-name">{{ __('state.categories') }}</span>
{%- if hasCategoriesPage %}</a>{%- endif %}
{%- if hasCategoriesPage %}</a>{% endif %}
</div>
{%- endif %}

Expand All @@ -44,7 +44,7 @@
{%- endif %}
<span class="site-state-item-count">{{ site.tags.length }}</span>
<span class="site-state-item-name">{{ __('state.tags') }}</span>
{%- if hasTagsPage %}</a>{%- endif %}
{%- if hasTagsPage %}</a>{% endif %}
</div>
{%- endif %}
</nav>
Expand All @@ -54,7 +54,7 @@
{%- if theme.chat.enable and (theme.chatra.enable or theme.tidio.enable or theme.gitter.enable) %}
<div class="sidebar-button site-overview-item animated">
<button{% if theme.gitter.enable %} class="js-gitter-toggle-chat-button"{% endif %}>
{%- if theme.chat.icon %}<i class="{{ theme.chat.icon }}"></i>{%- endif %}
{%- if theme.chat.icon %}<i class="{{ theme.chat.icon }}"></i>{% endif %}
{{ theme.chat.text }}
</button>
</div>
Expand Down Expand Up @@ -84,7 +84,7 @@
{%- if theme.links %}
<div class="links-of-blogroll site-overview-item animated">
<div class="links-of-blogroll-title">
{%- if theme.links_settings.icon %}<i class="{{ theme.links_settings.icon }} fa-fw"></i>{%- endif %}
{%- if theme.links_settings.icon %}<i class="{{ theme.links_settings.icon }} fa-fw"></i>{% endif %}
{{ theme.links_settings.title }}
</div>
<ul class="links-of-blogroll-list">
Expand Down
4 changes: 2 additions & 2 deletions layout/category.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<div class="post-block">
<div class="post-content">
<div class="collection-title">
<h2 class="collection-header">
<h1 class="collection-header">
{{- page.category }}
<small>{{ __('title.category') }}</small>
</h2>
</h1>
</div>

{{ post_template.render(page.posts) }}
Expand Down
2 changes: 1 addition & 1 deletion layout/index.njk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '_layout.njk' %}
{% import '_macro/sidebar.njk' as sidebar_template with context %}

{% block title %}{{ title }}{%- if theme.index_with_subtitle and subtitle %} - {{ subtitle }}{%- endif %}{% endblock %}
{% block title %}{{ title }}{% if theme.index_with_subtitle and subtitle %} - {{ subtitle }}{% endif %}{% endblock %}

{% block class %}index posts-expand{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion layout/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{#################}
{### PAGE BODY ###}
{#################}
<div class="post-body{%- if page.direction and page.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}">
<div class="post-body{% if page.direction and page.direction.toLowerCase() === 'rtl' %} rtl{% endif %}">
{%- if page.type === 'tags' %}
{%- include '_partials/page/tags.njk' -%}
{% elif page.type === 'categories' %}
Expand Down
4 changes: 2 additions & 2 deletions layout/tag.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<div class="post-block">
<div class="post-content">
<div class="collection-title">
<h2 class="collection-header">
<h1 class="collection-header">
{{- page.tag }}
<small>{{ __('title.tag') }}</small>
</h2>
</h1>
</div>

{{ post_template.render(page.posts) }}
Expand Down
1 change: 1 addition & 0 deletions source/css/_common/outline/header/site-meta.styl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
font-family: $font-family-logo;
font-size: $font-size-title;
font-weight: normal;
line-height: 1.5;
margin: 0;
}

Expand Down

0 comments on commit fc90c76

Please sign in to comment.