Skip to content

Commit 2318e43

Browse files
committed
a11y: #4232 table of contents landmarks
1 parent 6002116 commit 2318e43

File tree

7 files changed

+49
-36
lines changed

7 files changed

+49
-36
lines changed

src/themes/OLH/templates/cms/page.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ <h1 id="cms-title">{{ page.display_name }}</h1>
1818
<aside class="medium-4 columns sticky-container hide-for-small-only">
1919
<div class="sticky" data-sticky data-margin-top="0"
2020
data-anchor="content" data-sticky-on="large">
21-
<div class="section">
22-
<h3>{% trans "Table of Contents" %}</h3>
23-
<ul id="toc">
21+
<section aria-labelledby="toc-title">
22+
<div class="section">
23+
<h3 id="toc-title">{% trans "Table of Contents" %}</h3>
24+
<ul id="toc">
2425

25-
</ul>
26-
</div>
26+
</ul>
27+
</div>
28+
</section>
2729
</div>
2830
</aside>
2931
{% endif %}

src/themes/OLH/templates/journal/article.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,12 @@ <h3>{% trans "Non Specialist Summary" %}</h3>
479479

480480
{% if article_content %}
481481
<div id="toc-section" class="section hide-for-small-only">
482-
<h3>{% trans "Jump to" %}</h3>
483-
<ul id="toc">
482+
<section aria-labelledby="toc-title">
483+
<h3 id="toc-title">{% trans "Jump to" %}</h3>
484+
<ul id="toc">
484485

485-
</ul>
486+
</ul>
487+
</section>
486488
</div>
487489
{% endif %}
488490

src/themes/clean/templates/cms/page.html

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ <h1 id="cms-title">{{ page.display_name }}</h1>
1515
</div>
1616
{% if page.display_toc %}
1717
<div class="col-md-4 d-none d-sm-none d-md-block">
18-
<div class="sticky-top">
19-
<h2>{% trans "Table of Contents" %}</h2>
20-
<ul id="toc" class="table-of-contents"></ul>
21-
</div>
18+
<section aria-labelledby="toc-title">
19+
<div class="sticky-top">
20+
<h2 id="toc-title">{% trans "Table of Contents" %}</h2>
21+
<ul id="toc" class="table-of-contents"></ul>
22+
</div>
23+
</section>
2224
</div>
2325
{% endif %}
2426
</div>

src/themes/clean/templates/journal/article.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,10 @@ <h2>{% trans 'File Checksums' %}</h2> (MD5)
339339
</div>
340340
{% if article_content %}
341341
<div class="sticky-top" id="toc-section">
342-
<h2>{% trans "Table of Contents" %}</h2>
343-
<ul id="toc" class="table-of-contents"></ul>
342+
<section aria-labelledby="toc-title">
343+
<h2 id="toc-title">{% trans "Table of Contents" %}</h2>
344+
<ul id="toc" class="table-of-contents"></ul>
345+
</section>
344346
</div>
345347
{% endif %}
346348
</div>

src/themes/material/templates/cms/page.html

+10-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ <h1 class="no-bottom-margin">{{ page.display_name }}</h1>
1818
</div>
1919
{% if page.display_toc %}
2020
<div class="col m3 hide-on-small-and-down">
21-
<div class="card toc-card" id="toc-card"
22-
style="display: none;">
23-
<div class="card-content">
24-
<h4>
25-
{% trans "Table of Contents" %}
26-
</h4>
27-
<ul id="toc" class="section table-of-contents">
28-
</ul>
29-
</div>
21+
<div class="card toc-card" id="toc-card" style="display: none;">
22+
<section aria-labelledby="toc-title">
23+
<div class="card-content">
24+
<h4 id="toc-title">
25+
{% trans "Table of Contents" %}
26+
</h4>
27+
<ul id="toc" class="section table-of-contents">
28+
</ul>
29+
</div>
30+
</section>
3031
</div>
3132
</div>
3233
{% endif %}

src/themes/material/templates/journal/article.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -480,15 +480,17 @@ <h4>
480480
</div>
481481
</div>
482482
{% if article_content %}
483-
<div class="card toc-card hide-on-small-only" id="toc-card" style="display: none;">
484-
<div class="card-content" id="toc-section">
485-
<h4>
486-
{% trans "Table of Contents" %}
487-
</h4>
488-
<ul id="toc" class="section table-of-contents">
489-
</ul>
483+
<div class="card toc-card hide-on-small-only" id="toc-card" style="display: none;">
484+
<section aria-labelledby="toc-title">
485+
<div class="card-content" id="toc-section">
486+
<h4 id="toc-title">
487+
{% trans "Table of Contents" %}
488+
</h4>
489+
<ul id="toc" class="section table-of-contents">
490+
</ul>
491+
</div>
492+
</section>
490493
</div>
491-
</div>
492494
{% endif %}
493495
</div>
494496

src/themes/material/templates/journal/submissions.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ <h1>{% trans "Submissions" %}</h1>
7474
</div>
7575
<div class="col m4">
7676
<div class="card submission-toc-card hide-on-small-only" id="toc-card">
77-
<div class="card-content">
78-
<h4>{% trans "Table of Contents" %}</h4>
77+
<section aria-labelledby="toc-title">
78+
<div class="card-content">
79+
<h4 id="toc-title">{% trans "Table of Contents" %}</h4>
7980

80-
<ul id="toc" class="section table-of-contents">
81-
</ul>
82-
</div>
81+
<ul id="toc" class="section table-of-contents">
82+
</ul>
83+
</div>
84+
</section>
8385
</div>
8486
</div>
8587
</div>

0 commit comments

Comments
 (0)