Strategy for ensuring URL always contains the version #8013
-
What I'm trying to doI am looking to use Docusaurus for process documentation that goes through regular version updates: v2.0, v2.1, v2.2, v3.0 etc. The links to the documentation will be stored in a form of attestation store, so that if I wanted to check back six months ago and see the reference material for that attestation, I want it to link to that exact version. Ideally, I am after a way I can create a URL for the current version, like this: https://docusaurus.io/docs/2.0.1/versioning. An exampleThis is for a work project, so I don't have a reproducible example to share unfortunately, though I am very happy to make one if the below needs more explanation. So we have this link in the official Docusaurus docs: https://docusaurus.io/docs/versioning and it's currently on v2.0.1. But if I was to access this link 6 months in the future, it would default to the current version. And as right now this is the current version, I can't produce a versioned URL, only for older ones e.g. https://docusaurus.io/docs/2.0.0-rc.1/versioning. Ideas on an approachI was thinking to achieve this I could make the current version just a page saying "Please select a version via the drop-down" and then work out of the versioned docs folder. But thought to ask in case there are other strategies for this scenario. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You can configure the url path segment of each version independently, including the current version which defaults to path= https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#VersionsConfig docs: {
versions: {
current: {
path "v2.0.1":
},
},
},See also our versioning strategies guide: https://docusaurus.io/docs/versioning#configuring-versioning-behavior Might be related: there's also this idea of "version aliases" (#3285) that we never implemented |
Beta Was this translation helpful? Give feedback.

You can configure the url path segment of each version independently, including the current version which defaults to path=
/https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#VersionsConfig
See also our versioning strategies guide: https://docusaurus.io/docs/versioning#configuring-versioning-behavior
Might be related: there's also this idea of "version aliases" (#3285) that we never implemented