Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sphinx-based search #113

Merged
merged 2 commits into from
Nov 18, 2021
Merged

Fix sphinx-based search #113

merged 2 commits into from
Nov 18, 2021

Conversation

vsalvino
Copy link
Contributor

This theme currently breaks the built-in Sphinx search.

The built-in Sphinx search requires the document to have a role="main" attribute (also a good practice for screen readers, etc.) in order to know what content should be searched.

See: https://www.sphinx-doc.org/en/master/templating.html?highlight=role%3D%22main%22#blocks

@allcaps allcaps merged commit 420826a into wagtail:main Nov 18, 2021
@Scotchester
Copy link
Contributor

Hmm... I believe the <main> element carries an implied role="main". Shame that Sphinx requires it. We should make sure that it doesn't create an accessibility issue to have both <main> and a descendant with role="main".

@vsalvino
Copy link
Contributor Author

vsalvino commented Nov 18, 2021

<article> does permit use of the ARIA role=main (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article)

But yea, it seems a bit counter intuitive. I would be inclined to replace the <article> element with <main>, since that is actually the real content. The current <main> element has other cruft such as breadcrumbs, edit on github buttons, etc. which are not part of the actual content. The current <main> element should probably be replaced with a general purpose <div>.

There doesn't seem to be any useful guidance on <main> vs <article> 😕

@vsalvino
Copy link
Contributor Author

@Scotchester at the risk of bike-shedding, I made an alternate layout here... do you think that looks better?

#117

@vsalvino vsalvino mentioned this pull request Nov 19, 2021
@vsalvino vsalvino deleted the fix-search branch November 22, 2021 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants