Skip to content

feat(v2): provide doc sidebar_label through sidebars.js - #4500

Merged
slorber merged 14 commits into
meta:masterfrom
MLH-Fellowship:besemuna/iss4314
Mar 26, 2021
Merged

slorber merged 14 commits into
meta:masterfrom
MLH-Fellowship:besemuna/iss4314

Conversation

@samuelships

Copy link
Copy Markdown
Contributor

Motivation

Attempt to fix #4314. These are the changes I've made

  • update SidebarItemDoc type
  • update assertIsDoc function
  • allow configuring title from sidebar.js

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

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.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 23, 2021
@netlify

netlify Bot commented Mar 23, 2021 •

Copy link
Copy Markdown

@netlify

netlify Bot commented Mar 23, 2021 •

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Mar 23, 2021 •

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 47
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

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

@slorber slorber changed the title Besemuna/iss4314 feat(v2): sidebar doc label Mar 23, 2021
@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Mar 23, 2021
@slorber slorber changed the title feat(v2): sidebar doc label feat(v2): provide doc sidebar_label through sidebars.js Mar 23, 2021

@slorber slorber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @besemuna , the feature is working great and as I expected.

To be complete we need:

  • doc
  • unit tests (particularly showing that sidebarLabel is used in priority over item.label)
  • dogfooding on Docusaurus site itself

I suggest you refactor the i18n docs to declare the sidebar label to use through the sidebars.js file (using this new feature) instead of using frontmatter sidebar_label: xyz.

@slorber slorber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks

can you please remove the doc backport to older versions, apply my suggestion and add some tests?

Comment thread website/docs/guides/docs/sidebar.md Resolved
@slorber

slorber commented Mar 26, 2021

Copy link
Copy Markdown
Collaborator

Thanks, that looks great 👍

@slorber
slorber merged commit 9715048 into meta:master Mar 26, 2021
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* feat : update SidebarItemDoc type

* feat : update assertIsDoc

* feat : allow configuring title from sidebar.js

* feat : add docs

* docs : refactor i18n docs to use label in sidebar.js

* test : add test

* Update website/docs/guides/docs/sidebar.md

Co-authored-by: Sébastien Lorber <[email protected]>

* docs : remove backported docs

Co-authored-by: Lisa Chandra <[email protected]>
Co-authored-by: Javid <[email protected]>
Co-authored-by: Sébastien Lorber <[email protected]>
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: new feature This PR adds a new API or behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow configuring the title of a sidebar link in sidebar.js in plugin-docs

4 participants