hometown-fork / hometown

A supported fork of Mastodon that provides local posting and a wider range of content types.
GNU Affero General Public License v3.0
734 stars 56 forks source link

Page titles do not satisfy WCAG recommendation #1303

Open jugglinmike opened 1 year ago

jugglinmike commented 1 year ago

Hometown places the instance title before the page title on a number of pages, including the statuses page, the status page, and the directory.

This produces a suboptimal experience for folks using assistive technology, as explained in the WCAG's "Writing for Web Accessibility" guide (emphasis added):

For each web page, provide a short title that describes the page content and distinguishes it from other pages. The page title is often the same as the main heading of the page. Put the unique and most relevant information first; for example, put the name of the page before the name of the organization. For pages that are part of a multi-step process, include the current step in the page title.

This behavior appears to be unique to Friendcamp. Here's the title for a random user's "statuses" page in Mastodon 4.1.1:

jory burson (@jorydotcom@mastodon.social) - Mastodon

That said, a cursory review of the source code doesn't explain the behavior I've reported. By my reading, the relevant line is in app/views/layouts/application.html.haml:

%title= content_for?(:page_title) ? safe_join([yield(:page_title).chomp.html_safe, title], ' - ') : title

But that appears to satisfy the WGAC's recommendation.

Keep up the good work!