Skip to content

Commit

Permalink
fix: a few a11y header hierarchy issues
Browse files Browse the repository at this point in the history
- #167 card blocks should use h3 not h4 (we expect them under a subheading always)
- #177 category pages need an h1
- #177 category page row items should use h3
  • Loading branch information
phette23 committed Feb 5, 2025
1 parent 1d84f44 commit cfa4c8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions libraries/categories/templates/categories/blocks/card.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{% load wagtailcore_tags wagtailimages_tags %}
{% comment %} based on Portal's "card" template {% endcomment %}
<section class="card">
<!-- TODO: try h3 for a11y header hierarchy -->
<h4 class="card__header">
<h3 class="card__header">
<a class="card__link" href="{{ value.link.url }}">
{% image value.thumbnail fill-600x400 class="card__thumb" %}
<span class="card__title">{{ value.link.text|truncatewords:20 }}</span>
</a>
</h4>
</h3>
<div class="card__body">
{% comment %}
truncated on a bit of a "magic number" but this _usually_ results
Expand Down
2 changes: 2 additions & 0 deletions libraries/categories/templates/categories/category_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{% block body_class %}page--{{ page.slug }}{% endblock %}

{% block content %}
<h1 class="sr-only">{{ page.title }}</h1>

<div class="wrapper">
<ul class="services">
{% for row in rows %}
Expand Down
4 changes: 2 additions & 2 deletions libraries/categories/templates/categories/row-item.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% load wagtailcore_tags wagtailimages_tags %}

<li class="service-row-item">
<h2 class="service-row-item__title">
<h3 class="service-row-item__title">
<a href="{% pageurl item %}">{{ item.title }}</a>
</h2>
</h3>
<p class="service-row-item__text">
{{ item.search_description }}
</p>
Expand Down

0 comments on commit cfa4c8d

Please sign in to comment.