-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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): remove sidebar_label filed from doc metadata file #4863
Conversation
✔️ [V2] 🔨 Explore the source changes: e54780d 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/60b0db3bd58fc700072e933d 😎 Browse the preview: https://deploy-preview-4863--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4863--docusaurus-2.netlify.app/ |
✔️ [V1] 🔨 Explore the source changes: e54780d 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-1/deploys/60b0db3b698bc90007f8ad8d 😎 Browse the preview: https://deploy-preview-4863--docusaurus-1.netlify.app |
Size Change: 0 B Total Size: 620 kB ℹ️ View Unchanged
|
That makes sense thanks! For the slug, the metadata.slug is not exactly the same as frontMatter.slug (cf frontmatter slug is optional, but metadata slug is always present and computed using the frontmatter slug It seems only used in I think we should keep it because we should add better support for My idea of how this should work to make it easy to understand and maintain:
sidebar_label can be safely removed from metadata because we don't do any computation on it, so it's always the same value as the frontmatter value, and it's safe to read from the frontmatter directly |
Motivation
After merging #4495, all frontmatter fields became part of doc metadata, we have at least one redundant field -- sidebar_label. We can safely remove it from the current metadata, and get it from the
frontMatter
field instead.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Tests passed.
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.)