-
-
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
feat: new docs options: versions.{badge,className} #5454
Conversation
✔️ [V2] 🔨 Explore the source changes: 9024e62 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/612e07e25534220007241700 😎 Browse the preview: https://deploy-preview-5454--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5454--docusaurus-2.netlify.app/ |
@@ -69,6 +71,8 @@ export type VersionOptions = { | |||
path?: string; | |||
label?: string; | |||
banner?: VersionBanner; | |||
badge?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
badge?: boolean; | |
showBadge?: boolean; |
badge
is a noun but showBadge
sounds more boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, but I plan later to make it a string | boolean
so for better extensibility without breaking change I prefer to keep badge
here
Size Change: +156 B (0%) Total Size: 822 kB
ℹ️ View Unchanged
|
Motivation
More customization options for docs versions:
badge
allows to show/hide the version badge on a per-version basisclassName
allows to customize the rendering on a per-version basis. Class is applied to<html>
so that users can even target layout elements (a good use-case is to hide some navbar elements on a per-version basis using CSS, potential workaround for Dynamic navbar: navbar item activation strategies #4389)Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
tests