Skip to content

Commit 90ba11e

Browse files
authored
Merge pull request #44665 from sftim/20240107_avoid_double_h1_blog
Avoid two <h1> elements for blog section
2 parents 7901951 + 9fdb0eb commit 90ba11e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

assets/scss/_custom.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@ main.content {
680680
}
681681
}
682682

683+
.td-blog .header-hero h1, .td-blog .header-hero h2 {
684+
font-size: 2.25rem; // match rest of site, even if it is actually h2
685+
margin-bottom: 20px;
686+
}
687+
683688
/* CASE-STUDIES */
684689

685690
// Many of the case studies have small variations in markup and styles;
@@ -819,7 +824,8 @@ body.td-documentation {
819824
}
820825
}
821826

822-
#announcement + .header-hero.filler {
827+
/* don't display the hero header for some pages when there is a banner active */
828+
#announcement + .header-hero.filler, .td-page.td-blog #announcement + .header-hero {
823829
display: none;
824830
}
825831

layouts/blog/baseof.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
{{ partial "announcement.html" . }}
1414
{{ block "hero" . }}
1515
<section class="header-hero text-center text-white font-bold pb-4">
16-
<h1>
16+
{{ if .IsSection }}<h1>{{ else }}<h2>{{ end }}
1717
{{ $sectionHeading := .Site.GetPage "section" .Section }}
1818
{{ with $sectionHeading }}
1919
{{ .Title }}
2020
{{ end }}
21-
</h1>
21+
{{ if .IsSection }}</h1>{{ else }}</h2>{{ end }}
2222
</section>
2323
{{ block "hero-more" . }}{{ end }}
2424
{{ end }}

0 commit comments

Comments
 (0)