-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f98adef
commit af8c0b4
Showing
3 changed files
with
22 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 9 additions & 12 deletions
21
packages/docusaurus-init/templates/classic/docs/manage-versions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
--- | ||
title: Manage Versions | ||
title: Manage Versions | ||
--- | ||
|
||
Docusaurus gives you the option to have different versions of your docs, | ||
allowing you to update and have previous versions available. | ||
|
||
Docusaurus gives you the option to have different versions of your docs, allowing you to update and have previous versions available. | ||
|
||
### Tagging a new version | ||
To tag a new version make sure the content in the `docs` directory is ready to be | ||
frozen as a version. Run the following command to tag a version | ||
|
||
To tag a new version make sure the content in the `docs` directory is ready to be frozen as a version. Run the following command to tag a version | ||
|
||
```bash | ||
```bash | ||
npm run docusaurus docs:version <version> | ||
``` | ||
|
||
When a new `version` is tagged, the `docs/` directory content will be copied into `versioned_docs/version-<version>/` folder. A [sidebar](https://v2.docusaurus.io/docs/docs-introduction#sidebar) configuration will also be copiend and the version number added to `versions.json`. | ||
|
||
## Updating an existing version | ||
You can edit any version in its specific folder, comit and push changes and it will be published to that version. | ||
Example when you change any file in `versioned_docs/version-2.6/`, it will only affect the docs for `version 2.6` | ||
|
||
You can edit any version in its specific folder, comit and push changes and it will be published to that version. Example when you change any file in `versioned_docs/version-2.6/`, it will only affect the docs for `version 2.6` | ||
|
||
## Deleting an existing version | ||
You can delete an existing version by removing the version from `versions.json` file, deleting the docs directory, | ||
Example : `versioned_docs/version-1.8.0` and deleting the versioned sidebar file, Example : `versioned_sidebars/version-1.8.0-sidebars.json`. | ||
|
||
After tagging a new version or deleting an existing version, you can restart the site with `yarn restart` or `npm restart`. | ||
You can delete an existing version by removing the version from `versions.json` file, deleting the docs directory, Example : `versioned_docs/version-1.8.0` and deleting the versioned sidebar file, Example : `versioned_sidebars/version-1.8.0-sidebars.json`. | ||
|
||
After tagging a new version or deleting an existing version, you can restart the site with `yarn restart` or `npm restart`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters