feat: implement dynamic branch based docs versioning#757
Conversation
✅ Deploy Preview for witness-project ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
i don't see any dropdown for version? could you send me video or ss? |
24e8dbc to
7f63996
Compare
|
hey @manzil-infinity180 I can see the version selector entry as Next in the docs navbar. Before
Afterhttps://deploy-preview-757--witness-project.netlify.app/
|
14887b5 to
a7496ea
Compare
Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
9d115f8 to
904353f
Compare
|
@mikhailswift and @adityasaky do you have any opinions on this? This looks pretty good to me. I've tested it locally and I like the approach. The version drop isn't super obvious but, that's much easier to address if we have the rest of the workflow in place for this. |


Description
This PR resolves #537 by introducing dynamic, branch based versioning for the Docusaurus documentation site.
As suggested in the issue, rather than relying on Docusaurus's default behavior (which permanently duplicates older docs entirely into the
masterbranch and creates significant clutter over time), this approach allows maintaining older versions purely on remote Git branches nameddocs/X.Y.Z.Changes made
{ type: 'docsVersionDropdown' }indocusaurus.config.jsto render a native version dropdown for users to toggle.build-versions.shscript that runs in CI. Beforenpm run buildis called:docs/*(e.g.docs/0.7.0).git archiveto pull only the documentation from those specific older branches.versioned_docs/folder right at build time.versions.json.How to release a new version of docs going forward:
Whenever the maintainers want to snapshot a version (e.g.,
0.6.0), all they have to do is check out the commit they want and run:git checkout -b docs/0.6.0 && git push origin docs/0.6.0The setup in this PR will then automatically include it in the version dropdown!
Fixes #537
Acceptance Criteria Met