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

RFC: version archiving cli + docs version page #3286

Open
slorber opened this issue Aug 14, 2020 · 0 comments
Open

RFC: version archiving cli + docs version page #3286

slorber opened this issue Aug 14, 2020 · 0 comments
Labels
apprentice Issues that are good candidates to be handled by a Docusaurus apprentice / trainee feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@slorber
Copy link
Collaborator

slorber commented Aug 14, 2020

💥 Proposal

A Docusaurus 2 site can grow over time mostly due to:

  • Number of docs
  • Number of versions
  • Number of languages (once supported)

At the same time, we are a React SPA and the build times are impacted by the number of pages to build.

Some users who have lots pages will likely want to improve the build time, and "archive" older versions, as no contributions are being made to these versions anymore, so it's not worth it to keep them in the SPA part of Docusaurus.

What I'd like is to have a docusaurus archive --version 1.0.0 cli that:

  • builds the Docusaurus site on a single version
  • remove the version from the site (versions.json entry, docs folder, sidebar file...)
  • upload the version built as a standalone website (to Netlify, Vercel or other according to configuration)

Then I wonder if we couldn't add the deployment link to some config object (versions.json) and make the docs plugin create automatically a page with all the versions available. We'd link to this page as an item of the version dropdown.

On Docusaurus we have this page, but it's created manually: https://v2.docusaurus.io/versions

Also we don't archive versions so if you really want to read docs 2.0.0-alpha.53 you'd have to build form sources the site locally on the correct git tag, not very convenient.

I wonder if we shouldn't make versions.json an object instead of an array (we could support both for retrocompatibility):

{
  "versions": ["3.0.0", "2.0.0"],
  "archivedVersions": [
    { "name": "1.0.0", "url": "https://myfwk-1.0.0.netlify.com" },
    { "name": "0.1.0", "url": "https://myfwk-0.1.0.netlify.com" }
  ]
}

Does it make any sense?

Note, we need to keep this in a simple json file because we can manipulate a json file programmatically. That wouldn't be so easy if it we needed to append a version somewhere in a regular js file.


Note, when building to a standalone site, the versionsDropdown could become automatically a regular button, and we'd note include any other version in this standalone site.

image

Also worth considering the scenario where the user is using 2 instances of the docs plugin (like /ios and /android) and he wants to archive for example Android version 3: can we filter out all iOS related docs of this archived site?

@slorber slorber added proposal This issue is a proposal, usually non-trivial change status: needs triage This issue has not been triaged by maintainers and removed status: needs triage This issue has not been triaged by maintainers labels Aug 14, 2020
@slorber slorber changed the title RFC: docs version page + version archiving cli RFC: version archiving cli + docs version page Aug 14, 2020
@Josh-Cena Josh-Cena added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. and removed proposal This issue is a proposal, usually non-trivial change labels Oct 30, 2021
@slorber slorber added the apprentice Issues that are good candidates to be handled by a Docusaurus apprentice / trainee label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apprentice Issues that are good candidates to be handled by a Docusaurus apprentice / trainee 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

2 participants