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

refactor(v2): improve semantic doc sidebar markup #4940

Merged
merged 2 commits into from
Jun 15, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Jun 10, 2021

Motivation

Just make the markup for the doc sidebar a little more semantic.

Refs:

For example, Bootstrap, VuePress, Next.js sites use similar markup.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Preview (no visual changes, actually)

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Jun 10, 2021
@lex111 lex111 requested a review from slorber as a code owner June 10, 2021 09:16
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 10, 2021
)}
aria-label={translate({
id: 'theme.docs.sidebar.menuLabel',
message: 'Docs navigation',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought that maybe we shouldn't use the word "docs" in ARIA labels? After all, it won't always be exactly docs, right? Maybe should use "Secondary navigation" or something like that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatsby has "Secondary navigation" so why not. Isn't there value to also mention it's a sidebar? like Secondary navigation (sidebar) or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose simply "Sidebar navigation".

@netlify
Copy link

netlify bot commented Jun 10, 2021

✔️ [V1]

🔨 Explore the source changes: eae62d8

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-1/deploys/60c7cb0c7edd1400073a4011

😎 Browse the preview: https://deploy-preview-4940--docusaurus-1.netlify.app

@github-actions
Copy link

github-actions bot commented Jun 10, 2021

Size Change: +753 B (0%)

Total Size: 621 kB

Filename Size Change
website/build/assets/css/styles.********.css 87.8 kB +44 B (0%)
website/build/assets/js/main.********.js 444 kB +663 B (0%)
website/build/blog/2017/12/14/introducing-docusaurus/index.html 62.2 kB +46 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 27 kB 0 B

compressed-size-action

@netlify
Copy link

netlify bot commented Jun 10, 2021

✔️ [V2]

🔨 Explore the source changes: eae62d8

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/60c7cb0c3542220007d90330

😎 Browse the preview: https://deploy-preview-4940--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Jun 10, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 57
🟢 Accessibility 97
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4940--docusaurus-2.netlify.app/

)}>
)}
aria-label={translate({
id: 'theme.docs.sidebar.menuLabel',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
id: 'theme.docs.sidebar.menuLabel',
id: 'theme.docs.sidebar.menuAriaLabel',

By convention, making it clear it's an aria label through the id is helpful for translators to understand why they don't find this string on the UI (not all will try to open base.json to see the description)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about navAriaLabel for consistency with the blog?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

)}
aria-label={translate({
id: 'theme.docs.sidebar.menuLabel',
message: 'Docs navigation',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatsby has "Secondary navigation" so why not. Isn't there value to also mention it's a sidebar? like Secondary navigation (sidebar) or something?

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if all aria label keys contain AriaLabel by convention and for consistency

@slorber
Copy link
Collaborator

slorber commented Jun 15, 2021

👍

@slorber slorber merged commit c8b9061 into master Jun 15, 2021
@slorber slorber deleted the lex111/improve-semantic branch August 17, 2021 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants