Skip to content

Commit 7683f66

Browse files
Merge pull request #937 from creativecommons/kris70lesgo/main
Revised: Enhance accessibility by adding ARIA attributes to local content sections
2 parents c1fca10 + 0883a75 commit 7683f66

7 files changed

Lines changed: 23 additions & 16 deletions

File tree

themes/vocabulary_theme/templates/blog-categories.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
{% block title %}Categories{% endblock %}
66

77
{% block body %}
8-
<div class="all-categories">
8+
<section class="all-categories">
99
<div class="header">
1010
<h1 class="container">Categories</h1>
1111
</div>
1212
<div class="categories-list container">
1313
{{ render_categories(this) }}
1414
</div>
15-
</div>
15+
</section>
1616
{% endblock %}

themes/vocabulary_theme/templates/blog-series-list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
{% block title %}All Series{% endblock %}
66

77
{% block body %}
8-
<div class="all-series">
8+
<section class="all-series">
99
<div class="header">
1010
<h1 class="container">All Series</h1>
1111
</div>
1212
<div class="series-list container">
1313
{{ render_series(this) }}
1414
</div>
15-
</div>
15+
</section>
1616
{% endblock %}

themes/vocabulary_theme/templates/cc-search-guide.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h4>Steps</h4>
2121
</a>
2222
</li>
2323
{% set step.number = step.number + 1 %}
24-
{% endif%}
24+
{% endif %}
2525
{% endfor %}
2626
</ul>
2727
</div>

themes/vocabulary_theme/templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h2>Our Work Relies On You!</h2>
115115
{% for crumb in crumbs %}
116116
<!-- Active link -->
117117
{% if this._slug == crumb %}
118-
<li class="is-active"><a aria-current="page displayed">{{ this.title }}</a></li>
118+
<li class="is-active"><a aria-current="page">{{ this.title }}</a></li>
119119
{% else %}
120120
<!-- Forming the URL using extracted slugs -->
121121
{% set i = loop.index %}

themes/vocabulary_theme/templates/macros/authors_gravatar.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{% macro render_author_gravatar(post, skip_gravatar=false) %}
22
{% if not skip_gravatar %}
3-
{# only display gravatar for first author so layout is broken #}
3+
{# only display gravatar for first author so layout is not broken #}
44
{% set author = post.author[0] %}
55
{% set current_author = post.parent.parent.children.get('authors').children.get(author) %}
66
<header>
77
<figure class="image blog-image">
8-
{% if post.author|length >= 2 %}
9-
<img class="profile" src="/multiple-authors.jpg" alt="multiple authors image"/>
10-
{% else %}
11-
<img class="profile" src="https://secure.gravatar.com/avatar/{{ current_author.md5_hashed_email }}?size=200&d=mp" alt="author's gravatar" />
12-
{% endif %}
8+
{% if post.author|length >= 2 %}
9+
<img class="profile" src="/multiple-authors.jpg" alt="multiple authors image" />
10+
{% else %}
11+
<img class="profile" src="https://secure.gravatar.com/avatar/{{ current_author.md5_hashed_email }}?size=200&d=mp" alt="author's gravatar" />
12+
{% endif %}
1313
</figure>
1414
</header>
1515
{% endif %}

themes/vocabulary_theme/templates/macros/og_image.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
{% if author and author.md5_hashed_email %}
1616
{% set gravatarURL = 'https://secure.gravatar.com/avatar/' + author.md5_hashed_email + '?size=300&d=mp' %}
1717
{% set queryParams = queryParams + '&images=' + gravatarURL %}
18-
{% set pageTitle = page.title + "<br><sm style='font-size:70px;'>By " + render_author_name(author) + "</sm>" %}
18+
{% set pageTitle = page.title + "<br><sm style='font-size:70px;'>By " + render_author_name(author) + "</sm>" %}
1919
{% endif %}
2020
{% endif %}
2121

2222
{% set url = baseUrl + pageTitle + '.png' + queryParams %}
2323

2424
<meta property="og:image" content="{{ url }}" />
25+
<meta name="description" content="{{ pageTitle }} - CC Open Source" />
2526
{% endmacro %}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
{% from "macros/posts.html" import render_posts %}
22

33
{% macro render_series(series) %}
4-
{% for serie in site.query(series.path) %}
5-
<h4 class="series-link"><a class="link" href="{{ serie|url }}">{{ serie.name }}</a></h4>
6-
{% endfor %}
4+
<section>
5+
<h2 class="visually-hidden">List of Series</h2>
6+
{% for serie in site.query(series.path) %}
7+
<h4 class="series-link">
8+
<a class="link" href="{{ serie|url }}" aria-label="View series: {{ serie.name }}">{{ serie.name }}</a>
9+
</h4>
10+
{% endfor %}
11+
</section>
712
{% endmacro %}
13+

0 commit comments

Comments
 (0)