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

Allow defining which version is "unmaintained" on the banner #3169

Closed
eriveltonelias opened this issue Jul 30, 2020 · 4 comments
Closed

Allow defining which version is "unmaintained" on the banner #3169

eriveltonelias opened this issue Jul 30, 2020 · 4 comments
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@eriveltonelias
Copy link

Motivation

After this PR #2916 every version that isn't the latest one, is considered as unmaintained ( which is cool ), but on react navigation we still maintaining two versions v4 and v5

Pitch

will be nice to define which version still maintained or unmaintained ( it will solve this use case ), maybe on docusaurus config or versions ?

@eriveltonelias eriveltonelias added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Jul 30, 2020
@slorber
Copy link
Collaborator

slorber commented Jul 30, 2020

There's a DocVersionSuggestions for that banner, you can probably swizzle it and make sure it displays nothing for a specific version.

If you feel we should provide a config option, curious to know what kind of api you have in mind exactly?

This is something we should have, but we need a good api to fit all needs, not just this particular usecase.

@eriveltonelias
Copy link
Author

eriveltonelias commented Jul 30, 2020

There's a DocVersionSuggestions for that banner, you can probably swizzle it and make sure it displays nothing for a specific version.

Could you explain a little bit more about the DocVersionSuggestions?

if we swizzle it, the changes will be global for every type of banner? or it is flexible to change only the "unmaintained"? ( because this banner seems hardcoded )

If you feel we should provide a config option, curious to know what kind of api you have in mind exactly?

I have two in mind:

  1. add it to versions.json and it could be something like this:
[
    "2.0.0-alpha.60",
    "2.0.0-alpha.58",
     {
        version:   "2.0.0-alpha.56",
        unmaintained: true // it will make to show the banner
     },
     ...
 ]
  1. add it on themeConfig
unmaintained: [  
  "2.0.0-alpha.56",
  "2.0.0-alpha.55",
  "2.0.0-alpha.54" 
]

I don't like the first option because it will be a huge breaking change and it will be required to do unnecessary changes and mix of types in here will not be good.

but the second option will be simpler to implement since we'll get this info directly from the config.

edit:

There's a DocVersionSuggestions for that banner, you can probably swizzle it and make sure it displays nothing for a specific version.

hmm... I get it, if we can make DocVersionSuggestions custom/rewrite will solve our usecase.

https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-theme-classic/src/theme/DocVersionSuggestions/index.tsx

@eriveltonelias
Copy link
Author

@slorber definitely swizzle DocVersionSuggestions solve the problem and I don't think is really necessary this config since is so flexible, thanks!

@slorber
Copy link
Collaborator

slorber commented Jul 31, 2020

Great to know

The problem with Swizzle is that the API surface is less clear and we might do breaking changes on updates, but this shouldn't be too hard to handle by reswizzling and comparing diffs

@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs triage This issue has not been triaged by maintainers labels Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

3 participants