Merge pull request #44665 from sftim/20240107_avoid_double_h1_blog

Avoid two <h1> elements for blog section
pull/44939/head
Kubernetes Prow Robot 2024-01-29 07:21:05 -08:00 committed by GitHub
commit 90ba11ee3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 }}