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

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

Merged
merged 14 commits into from
Mar 26, 2021

Conversation

samuelships
Copy link
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
Copy link

netlify bot commented Mar 23, 2021

@netlify
Copy link

netlify bot commented Mar 23, 2021

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit 3723ff0

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

@github-actions
Copy link

github-actions bot commented Mar 23, 2021

⚡️ 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
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.

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.

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.

thanks

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

website/docs/guides/docs/sidebar.md Outdated Show resolved Hide resolved
@slorber
Copy link
Collaborator

slorber commented Mar 26, 2021

Thanks, that looks great 👍

@slorber slorber merged commit 9715048 into facebook:master Mar 26, 2021
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
5 participants