- First, make sure your content in the
documentation/docs
directory is ready to be frozen as a version. A version always should be based from master.
- Copy the full
documentation/docs/
folder contents from above into a newdocumentation/versioned_docs/version-<version>/
folder. - Create a versioned sidebars file in
documentation/versioned_sidebars/version-<version>-sidebars.json
. - Append the new version number to
documentation/versions.json
.
- Place the new file into the corresponding version folder.
- Include the reference for the new file into the corresponding sidebar file, according to version number.
Next version docs
# The new file.
documenatation/docs/new.md
Older version docs
# The new file.
documenatation/versioned_docs/version-1.0.0/new.md
# Edit the corresponding sidebar file.
documenatation/versioned_sidebars/version-1.0.0-sidebars.json
Each directory in documentation/versioned_docs/
will represent a documentation version.
You can update multiple docs versions at the same time because each directory in documentation/versioned_docs/
represents specific routes when published.
- Edit any file.
- Commit and push changes.
- It will be published to the version.
Example: When you change any file in documentation/versioned_docs/version-2.6/
, it will only affect the docs for version 2.6
.
You can delete/remove versions as well.
- Remove the version from
documentation/versions.json
.
Example:
[
"2.0.0",
"1.9.0",
- "1.8.0"
]
- Delete the versioned docs directory. Example:
documentation/versioned_docs/version-1.8.0
. - Delete the versioned sidebars file. Example:
documentation/versioned_sidebars/version-1.8.0-sidebars.json
.