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: new docs options: versions.{badge,className} #5454

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Aug 31, 2021

Motivation

More customization options for docs versions:

  • badge allows to show/hide the version badge on a per-version basis
  • className 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

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Aug 31, 2021
@slorber slorber requested a review from lex111 as a code owner August 31, 2021 10:43
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 31, 2021
@netlify
Copy link

netlify bot commented Aug 31, 2021

✔️ [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

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

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

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;
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
badge?: boolean;
showBadge?: boolean;

badge is a noun but showBadge sounds more boolean

Copy link
Collaborator Author

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

@github-actions
Copy link

Size Change: +156 B (0%)

Total Size: 822 kB

Filename Size Change
website/build/docs/index.html 44.7 kB +37 B (0%)
website/build/docs/installation/index.html 52.7 kB +37 B (0%)
website/build/tests/docs/index.html 25 kB +32 B (0%)
website/build/tests/docs/standalone/index.html 22.6 kB +32 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 36.5 kB +3 B (0%)
website/build/assets/css/styles.********.css 93.7 kB 0 B
website/build/assets/js/main.********.js 412 kB +6 B (0%)
website/build/blog/2017/12/14/introducing-docusaurus/index.html 66.8 kB +3 B (0%)
website/build/blog/index.html 37.6 kB +3 B (0%)
website/build/index.html 30.4 kB +3 B (0%)

compressed-size-action

@slorber slorber merged commit 42e70e6 into main Aug 31, 2021
@slorber slorber deleted the slorber/version-badge-option branch August 31, 2021 13:40
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.

3 participants