Skip to content

Commit ec5d974

Browse files
authored
Merge pull request #11355 from akramcodez/fix/homepage-accessibility
fix: improve homepage accessibility for screen readers
2 parents e0f46f8 + f0978c2 commit ec5d974

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

openlibrary/i18n/messages.pot

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5569,11 +5569,6 @@ msgstr ""
55695569
msgid "Browse by Subject"
55705570
msgstr ""
55715571

5572-
#: home/categories.html
5573-
#, python-format
5574-
msgid "browse %(subject)s books"
5575-
msgstr ""
5576-
55775572
#: home/categories.html
55785573
#, python-format
55795574
msgid "%(count)s Book"

openlibrary/templates/home/about.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ <h2>$_('About the Project')</h2>
77

88
<div id="home-about">
99
<div id="home-about-mission">
10-
<h3 id="home-about-mission-tldr">
10+
<p id="home-about-mission-tldr">
1111
$_("Open Library is an open, editable library catalog, building towards a web page for every book ever published.")
1212
<a href="/about" class="small sansserif">$_("More")</a>
13-
</h3>
13+
</p>
1414
<p id="home-about-mission-desc">
1515
$:_('Just like Wikipedia, you can contribute new information or corrections to the catalog. You can browse by <a href="/subjects">subjects</a>, <a href="/authors">authors</a> or <a href="/lists">lists</a> members have created. If you love books, why not help build a library?')
1616
</p>
1717
</div>
1818
<div class="home-resource-section">
19-
<h3 class="collapse"><a href="https://blog.openlibrary.org/" class="header">$_('Latest Blog Posts')</a></h3>
19+
<h3 class="collapse">
20+
<a href="https://blog.openlibrary.org/" class="header">$_('Latest Blog Posts')</a>
21+
</h3>
2022
<ul id="olBlog">
2123
$if blog_posts:
2224
$for post in blog_posts[:3]:

openlibrary/templates/home/categories.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h2 class="home-h2"><a href="/subjects">$_('Browse by Subject')</a></h2>
1919
<img class="category-img" src="/static/images/categories/$(icon).svg"
2020
width="30" height="30"
2121
loading="lazy"
22-
alt="$_('browse %(subject)s books', subject=presentable_subject_name)"/>
22+
alt=""/>
2323
</div>
2424
<p class="category-title">$presentable_subject_name</p>
2525
$if 'work_count' in subject:

openlibrary/templates/home/onboarding_card.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
$data_ol_link_track
2121
>
2222
<img src="$img_src"
23+
alt=""
2324
$# Could not set attribution in the same way as data_ol_link_track, because
2425
$# every other string in `attribution` became an attribute for this element.
2526
$if attribution:

openlibrary/templates/lib/nav_head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
</select>
9595
</label>
9696
</div>
97-
<form class="search-bar-input" action="/search" method="get">
97+
<form class="search-bar-input" action="/search" method="get" role="search">
9898
<input type="text" name="q" placeholder="$_('Search')" aria-label="Search" autocomplete="off">
9999
<input name="mode" type="checkbox" aria-hidden="true" aria-label="Search checkbox" checked="checked" value="" id="ftokenstop" class="hidden instantsearch-mode">
100100
<input type="submit" value="" class="search-bar-submit" aria-label="Search submit">

openlibrary/templates/site/body.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
$:render_template("site/alert")
2323
$:render_template("lib/nav_head", None)
2424
$# don't render test-body-mobile for iframes
25-
<div $:('id="test-body-mobile"' if show_ol_shell else '')>
25+
<main $:('id="test-body-mobile"' if show_ol_shell else '')>
2626
$if show_ol_shell:
2727
$#print errors (hidden by default as styles are loaded via JS)
2828
<div class="flash-messages">
@@ -37,4 +37,4 @@
3737
$if announcement and cookie_name:
3838
$:render_template('site/banner', announcement, cookie_name, cookie_duration_days=30)
3939
$:page
40-
</div>
40+
</main>

0 commit comments

Comments
 (0)