Skip to content

Commit 8736e86

Browse files
Coll76thibaudcolas
andauthored
Add screen-reader-only h2 to breads and locations index pages (#569)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
1 parent fe57d73 commit 8736e86

5 files changed

Lines changed: 12 additions & 5 deletions

File tree

bakerydemo/templates/base/home_page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h2 class="featured-cards__title">{{ page.featured_section_1_title }}</h2>
3232
<ul class="featured-cards__list">
3333
{% for childpage in page.featured_section_1.specific.children|slice:"3" %}
3434
<li>
35-
{% include "includes/card/listing-card.html" with page=childpage %}
35+
{% include "includes/card/listing-card.html" with page=childpage h2=False %}
3636
</li>
3737
{% endfor %}
3838
</ul>

bakerydemo/templates/breads/breads_index_page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ul class="bread-list">
99
{% for bread in breads %}
1010
<li>
11-
{% include "includes/card/listing-card.html" with page=bread %}
11+
{% include "includes/card/listing-card.html" with page=bread h2=True %}
1212
</li>
1313
{% endfor %}
1414
</ul>

bakerydemo/templates/includes/card/listing-card.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
</figure>
99
{% endif %}
1010
<div class="listing-card__contents">
11-
<h3 class="listing-card__title">{{ page.title }}</h3>
11+
{% if h2 %}
12+
<h2 class="listing-card__title">{{ page.title }}</h2>
13+
{% else %}
14+
<h3 class="listing-card__title">{{ page.title }}</h3>
15+
{% endif %}
1216
{% if page.origin or page.bread_type %}
1317
<table class="listing-card__meta">
1418
{% if page.origin %}

bakerydemo/templates/includes/card/picture-card.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
{% picture page.image format-{avif,webp,jpeg} fill-{300x200-c75,645x480-c75} sizes="(max-width: 768px)150px,30vw" loading="lazy" %}
1010
{% endif %}
1111
<div class="picture-card__contents">
12-
<h3 class="picture-card__title">{{ page.title }}</h3>
12+
{% if portrait %}
13+
<h3 class="picture-card__title">{{ page.title }}</h3>
14+
{% else %}
15+
<h2 class="picture-card__title">{{ page.title }}</h2>
16+
{% endif %}
1317
</div>
1418
</figure>
1519
</a>

bakerydemo/templates/locations/locations_index_page.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
</div>
1414
</div>
1515
{% endblock content %}
16-

0 commit comments

Comments
 (0)