Avoid two <h1> elements for blog section

Change the layouts so that pages in the blog section don't have two <h1>
elements.

Co-authored-by: Gaurav Padam <gauravpadam2@gmail.com>
pull/44665/head
Tim Bannister 2024-01-07 15:29:05 +00:00
parent a6dcb53419
commit 9fdb0eb76b
2 changed files with 9 additions and 3 deletions

View File

@ -680,6 +680,11 @@ main.content {
}
}
.td-blog .header-hero h1, .td-blog .header-hero h2 {
font-size: 2.25rem; // match rest of site, even if it is actually h2
margin-bottom: 20px;
}
/* CASE-STUDIES */
// Many of the case studies have small variations in markup and styles;
@ -819,7 +824,8 @@ body.td-documentation {
}
}
#announcement + .header-hero.filler {
/* don't display the hero header for some pages when there is a banner active */
#announcement + .header-hero.filler, .td-page.td-blog #announcement + .header-hero {
display: none;
}

View File

@ -13,12 +13,12 @@
{{ partial "announcement.html" . }}
{{ block "hero" . }}
<section class="header-hero text-center text-white font-bold pb-4">
<h1>
{{ if .IsSection }}<h1>{{ else }}<h2>{{ end }}
{{ $sectionHeading := .Site.GetPage "section" .Section }}
{{ with $sectionHeading }}
{{ .Title }}
{{ end }}
</h1>
{{ if .IsSection }}</h1>{{ else }}</h2>{{ end }}
</section>
{{ block "hero-more" . }}{{ end }}
{{ end }}