docs-hub
docs-hub copied to clipboard
Support multiple docs versions
The current docs support only two modes: stable and nightly, where the stable reflects the latest release. This means that, for any of the docs that our docs hub supports, our users can't find older docs. This will become a bigger issue with the introduction of LTS versions.
To fix this, the docs-hub has to be updated on two fronts:
- Getting all the versions of interest for every repository supported by the hub,
- Making those versions available in the UI
By solving this as proposed, one would also solve
- #570
Getting all the docs versions
First, we'll have to decide on which versions we're going to show on the docs - only the LTS ones or all the releases (e.g. we pick a certain version as a starting point for each repository and generate docs for that and all newer versions). The logic described below would be the same, regardless of the choice.
As far as how to get all the versions for every submodule, it seems to me that this is best approached by getting all the commit ids (tags) of the releases for every submodule, checking out each commit, and copy-pasting its docs to a dedicated folder. After that is done, we would guide contentlayer here to include all those folders and it'd create docs for all versions.
Showing them in UI
The UI is currently not set up to support multiple docs versions properly; it can only distinguish between stable and nightly. A nice user experience that supports multiple versions would allow the following:
- Ability to access versioned docs via links (e.g.
https://docs.fuel.network/docs/fuels-rs/0.69.0/getting-started/for v0.69.0). - Ability to set docs versions for every docs independently and easily (e.g. I want to see
[email protected]and[email protected]) - (questionable) Have the docs versions be remembered in my local storage so that when I navigate to docs.fuel.network that the versions are already set appropriately
- Accessing docs via the navbar would add the version into the link (e.g. clicking on the Rust SDK docs would give
https://docs.fuel.network/docs/fuels-rs/latest/ orhttps://docs.fuel.network/docs/fuels-rs/0.70.0/`)