-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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): clarify versions page #3577
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 84aa3c7 |
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.
Hi,
LGTM, but as we deploy the bootstrap theme without any version, the pastVersions array is empty (versioning disabled so that netlify build is not too slow due to multiple builds)
We should rather fallback to "latestVersion", or consider in render that stableVersion may be undefined.
@@ -20,8 +20,9 @@ function Version() { | |||
const pastVersions = versions.filter( | |||
(version) => version !== latestVersion && version.name !== 'current', | |||
); | |||
|
|||
const stableVersion = pastVersions.shift(); |
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.
const stableVersion = pastVersions.shift(); | |
const stableVersion = pastVersions.shift() ?? latestVersion; |
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.
(just an idea, this wn't lead to a good deploy preview versions page for the bootstrap theme, but probably not a big deal anyway)
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.
This solution is ok? 84aa3c7
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.
looks even better ;)
Motivation
Resolves #3572
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Preview
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.)