Skip to content

Commit 56edf94

Browse files
authored
Fix accessibility issues on About Us speaker links and YouTube embed (#120)
- Remove invalid `alt` attribute from `<a>` elements in the Past Speakers list on the About Us page. The `alt` attribute is not valid on `<a>` elements (it only applies to `<img>`, `<area>`, and `<input type="image">`). The link's accessible name is already provided by the heading text it contains. Fixes #92. - Make `embed_youtube.html` accept a `title` parameter and use it as the iframe `title`, falling back to "Embedded YouTube video" if none is provided. The meetup layout now passes the meetup topic, so screen-reader users hear a descriptive frame title instead of the generic "YouTube video". Aligns with WCAG 2.4.1 (Bypass Blocks) and 4.1.2 (Name, Role, Value). Fixes #91.
1 parent 71b58aa commit 56edf94

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

_includes/embed_youtube.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
{%- comment -%}
22
Usage:
3-
{% include embed_youtube.html youtubeID="Yw6u6YkTgQ4" %}
4-
Replace "dQw4w9WgXcQ" with the ID of the YouTube video you want to embed.
3+
{% include embed_youtube.html youtubeID="Yw6u6YkTgQ4" title="Descriptive title of the video" %}
4+
Replace "Yw6u6YkTgQ4" with the ID of the YouTube video you want to embed.
5+
The `title` parameter is required for accessibility (WCAG 2.4.1, 4.1.2) and
6+
should describe the specific video being embedded.
57
This embed uses the privacy-enhanced "youtube-nocookie.com" URL.
68
{%- endcomment -%}
79

10+
{%- assign embed_title = include.title | default: "Embedded YouTube video" -%}
11+
812
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%;">
9-
<iframe
13+
<iframe
1014
src="https://www.youtube-nocookie.com/embed/{{ include.youtubeID }}?modestbranding=1&color=white&iv_load_policy=3"
1115
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
1216
frameborder="0"
1317
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
1418
allowfullscreen
15-
title="YouTube video"
19+
title="{{ embed_title | escape }}"
1620
loading="lazy"
1721
referrerpolicy="strict-origin-when-cross-origin">
1822
</iframe>

_layouts/meetup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h1>{{ page.topic }}</h1>
6666
{% if page.youtubeID %}
6767
<section>
6868
<h2>Recording</h2>
69-
{% include embed_youtube.html youtubeID=page.youtubeID %}
69+
{% include embed_youtube.html youtubeID=page.youtubeID title=page.topic %}
7070
</section>
7171
{% endif %}
7272

_pages/about-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ redirect_from: /get-in-touch/
4040
{% for speaker in featured_speakers limit:9 %}
4141

4242
<hgroup>
43-
<a href="{{speaker.url}}" alt="{{speark.title}}"><h4>{{ speaker.title }}</h4></a>
43+
<a href="{{speaker.url}}"><h4>{{ speaker.title }}</h4></a>
4444
<p>
4545
{% if speaker.organization %}
4646
{% assign organization_list = "" | split: "" %}

0 commit comments

Comments
 (0)