File tree 4 files changed +21
-10
lines changed
theme/pydata_sphinx_theme
4 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -468,7 +468,9 @@ function showVersionWarningBanner(data) {
468
468
return ;
469
469
}
470
470
// now construct the warning banner
471
- var outer = document . createElement ( "div" ) ;
471
+ var outer = document . createElement ( "aside" ) ;
472
+ // TODO: add to translatable strings
473
+ outer . setAttribute ( "aria-label" , "Version warning" ) ;
472
474
const middle = document . createElement ( "div" ) ;
473
475
const inner = document . createElement ( "div" ) ;
474
476
const bold = document . createElement ( "strong" ) ;
@@ -504,7 +506,8 @@ function showVersionWarningBanner(data) {
504
506
inner . appendChild ( bold ) ;
505
507
inner . appendChild ( document . createTextNode ( "." ) ) ;
506
508
inner . appendChild ( button ) ;
507
- document . body . prepend ( outer ) ;
509
+ const skipLink = document . getElementById ( "pst-skip-link" ) ;
510
+ skipLink . after ( outer ) ;
508
511
}
509
512
510
513
/*******************************************************************************
Original file line number Diff line number Diff line change 1
1
{# Displays links to the Sphinx-generated indices (genindex, modindex, py-modindex). #}
2
- < nav class ="sidebar-indices-items ">
3
- < p class ="sidebar-indices-items__title " role ="heading " aria-level ="1 "> {{ _("Indices") }}</ p >
2
+ {%- set indices_navigation_heading_id = unique_html_id("pst-indices-navigation-heading") -%}
3
+ < nav class ="sidebar-indices-items " aria-labelledby ="{{ indices_navigation_heading_id }} ">
4
+ < p id ="{{ indices_navigation_heading_id }} " class ="sidebar-indices-items__title " role ="heading " aria-level ="1 "> {{ _("Indices") }}</ p >
4
5
< ul class ="indices-link ">
5
6
{%- for rellink in rellinks %}
6
7
{%- if rellink[0] == 'genindex' %}
Original file line number Diff line number Diff line change 1
1
{# Displays the current page's Table of Contents. #}
2
2
{% set page_toc = generate_toc_html() %}
3
3
{%- if page_toc | length > = 1 %}
4
- < div class ="page-toc tocsection onthispage ">
4
+ {%- set page_navigation_heading_id = unique_html_id("pst-page-navigation-heading") -%}
5
+ < div
6
+ id ="{{ page_navigation_heading_id }} "
7
+ class ="page-toc tocsection onthispage ">
5
8
< i class ="fa-solid fa-list "> </ i > {{ _("On this page") }}
6
9
</ div >
7
- < nav class ="bd-toc-nav page-toc ">
10
+ < nav class ="bd-toc-nav page-toc " aria-labelledby =" {{ page_navigation_heading_id }} " >
8
11
{{ page_toc }}
9
12
</ nav >
10
13
{%- endif %}
Original file line number Diff line number Diff line change 50
50
51
51
{# A button hidden by default to help assistive devices quickly jump to main content #}
52
52
{# ref: https://www.youtube.com/watch?v=VUR0I5mqq7I #}
53
- < a class ="skip-link " href ="#main-content "> {{ _("Skip to main content") }}</ a >
53
+ < a id =" pst-skip-link " class ="skip-link " href ="#main-content "> {{ _("Skip to main content") }}</ a >
54
54
55
55
{%- endblock %}
56
56
81
81
< div class ="search-button__overlay "> </ div >
82
82
< div class ="search-button__search-container "> {% include "../components/search-field.html" %}</ div >
83
83
</ div >
84
+
85
+ < header >
84
86
{%- if theme_announcement -%}
85
87
{% include "sections/announcement.html" %}
86
88
{%- endif %}
87
89
{% block docs_navbar %}
88
- < nav class ="bd-header navbar navbar-expand-lg bd-navbar ">
90
+ < div class ="bd-header navbar navbar-expand-lg bd-navbar ">
89
91
{%- include "sections/header.html" %}
90
- </ nav >
92
+ </ div >
91
93
{% endblock docs_navbar %}
94
+ </ header >
95
+
92
96
< div class ="bd-container ">
93
97
< div class ="bd-container__inner bd-page-width ">
94
98
{# Primary sidebar #}
107
111
{% block docs_body %}
108
112
{# This is empty and only shows up if text has been highlighted by the URL #}
109
113
{% include "components/searchbox.html" %}
110
- < article class ="bd-article " role =" main " >
114
+ < article class ="bd-article ">
111
115
{% block body %}{% endblock %}
112
116
</ article >
113
117
{% endblock docs_body %}
You can’t perform that action at this time.
0 commit comments