-
Notifications
You must be signed in to change notification settings - Fork 47
docs: update all version references from v1.0.0 to v1.1.0 and tested it #214
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
Open
AkarshSahlot
wants to merge
1
commit into
kmesh-net:main
Choose a base branch
from
AkarshSahlot:update-docs-versioning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -14,7 +14,7 @@ Docusaurus offers robust built-in support for versioning documentation, a critic | |
Docusaurus provides a straightforward system for versioning documentation: | ||
|
||
- **Current Version**: This is the latest, actively maintained version of your documentation, stored in the `docs/` folder. It typically represents the "Next" version or the most recent unreleased changes. | ||
- **Versioned Docs**: These are snapshots of your documentation at specific points in time, usually tied to software releases. They are stored in folders named `versioned_docs/version-<version>/`, such as `versioned_docs/version-1.0/` for version 1.0. | ||
- **Versioned Docs**: These are snapshots of your documentation at specific points in time, usually tied to software releases. They are stored in folders named `versioned_docs/version-<version>/`, such as `versioned_docs/version-1.1.0/` for version 1.1.0. | ||
|
||
For example: | ||
|
||
|
@@ -23,10 +23,10 @@ For example: | |
my-docusaurus-project/ | ||
├── docs/ # Current version documentation | ||
├── versioned_docs/ # All versioned documentation | ||
│ ├── version-1.0/ # Version 1.0 documentation | ||
│ ├── version-1.1.0/ # Version 1.1.0 documentation | ||
│ └── version-1.1/ # Version 1.1 documentation | ||
├── versioned_sidebars/ # Sidebars for each version | ||
│ ├── version-1.0-sidebars.json | ||
│ ├── version-1.1.0-sidebars.json | ||
│ └── version-1.1-sidebars.json | ||
└── versions.json # List of all available versions | ||
``` | ||
|
@@ -57,24 +57,24 @@ or | |
yarn docusaurus docs:version <version> | ||
``` | ||
|
||
Replace `<version>` with your desired version number, e.g., `1.0`. | ||
Replace `<version>` with your desired version number, e.g., `1.1.0`. | ||
|
||
- **What Happens**: | ||
- Docusaurus duplicates the entire `docs/` folder into `versioned_docs/version-1.0/`. | ||
- Docusaurus duplicates the entire `docs/` folder into `versioned_docs/version-1.1.0/`. | ||
- It updates the `versions.json` file, which tracks all versioned documentation. | ||
|
||
Example `versions.json` after creating version 1.0: | ||
Example `versions.json` after creating version 1.1.0: | ||
|
||
```json | ||
// File: versions.json | ||
[ | ||
"1.0" | ||
"1.1.0" | ||
] | ||
``` | ||
|
||
### Step 2: Customize Version Labels | ||
|
||
By default, the version number (e.g., "1.0") appears in the sidebar and version selector. You can customize these labels in `docusaurus.config.js`: | ||
By default, the version number (e.g., "1.1.0") appears in the sidebar and version selector. You can customize these labels in `docusaurus.config.js`: | ||
|
||
```javascript | ||
// File: docusaurus.config.js | ||
|
@@ -85,7 +85,7 @@ module.exports = { | |
docs: { | ||
sidebar: { | ||
versionLabels: { | ||
'1.0': 'Version 1.0 (Legacy)', | ||
'1.1.0': 'Version 1.1.0 (Legacy)', | ||
'1.1': 'Version 1.1', | ||
'current': 'Next (Unreleased)' | ||
}, | ||
|
@@ -125,7 +125,7 @@ This creates a new snapshot in `versioned_docs/version-2.0/` and updates `versio | |
// File: versions.json (after adding version 2.0) | ||
[ | ||
"2.0", | ||
"1.0" | ||
"1.1.0" | ||
] | ||
``` | ||
|
||
|
@@ -136,16 +136,16 @@ To delete a version: | |
```bash | ||
# File: terminal command | ||
# 1. Remove the version folder | ||
rm -rf versioned_docs/version-1.0 | ||
rm -rf versioned_sidebars/version-1.0-sidebars.json | ||
rm -rf versioned_docs/version-1.1.0 | ||
rm -rf versioned_sidebars/version-1.1.0-sidebars.json | ||
|
||
# 2. Update versions.json manually | ||
``` | ||
|
||
Edit `versions.json` to remove the version: | ||
|
||
```json | ||
// File: versions.json (after removing version 1.0) | ||
// File: versions.json (after removing version 1.1.0) | ||
[ | ||
"2.0" | ||
] | ||
|
@@ -164,18 +164,18 @@ When you create a version, Docusaurus automatically creates a sidebar configurat | |
```json | ||
// File: versioned_sidebars/version-1.0-sidebars.json (automatically generated) | ||
{ | ||
"version-1.0/docs": [ | ||
"version-1.1.0/docs": [ | ||
{ | ||
"type": "category", | ||
"label": "Getting Started", | ||
"items": [ | ||
{ | ||
"type": "doc", | ||
"id": "version-1.0/intro" | ||
"id": "version-1.1.0/intro" | ||
}, | ||
{ | ||
"type": "doc", | ||
"id": "version-1.0/installation" | ||
"id": "version-1.1.0/installation" | ||
} | ||
] | ||
} | ||
|
@@ -188,20 +188,20 @@ When you create a version, Docusaurus automatically creates a sidebar configurat | |
For more control, you can modify the versioned sidebar file directly: | ||
|
||
```javascript | ||
// File: versioned_sidebars/version-1.0-sidebars.json (customized) | ||
// File: versioned_sidebars/version-1.1.0-sidebars.json (customized) | ||
{ | ||
"version-1.0/docs": [ | ||
"version-1.1.0/docs": [ | ||
{ | ||
"type": "category", | ||
"label": "Getting Started", | ||
"items": [ | ||
{ | ||
"type": "doc", | ||
"id": "version-1.0/intro" | ||
"id": "version-1.1.0/intro" | ||
}, | ||
{ | ||
"type": "doc", | ||
"id": "version-1.0/installation" | ||
"id": "version-1.1.0/installation" | ||
} | ||
] | ||
}, | ||
|
@@ -211,7 +211,7 @@ For more control, you can modify the versioned sidebar file directly: | |
"items": [ | ||
{ | ||
"type": "doc", | ||
"id": "version-1.0/advanced/configuration" | ||
"id": "version-1.1.0/advanced/configuration" | ||
} | ||
] | ||
} | ||
|
@@ -249,7 +249,7 @@ In your documentation, you can link to specific versions: | |
```markdown | ||
<!-- File: docs/my-doc.md --> | ||
|
||
Check our [installation guide for v1.0](/docs/1.0/installation) or the [latest installation guide](/docs/installation). | ||
Check our [installation guide for v1.1.0](/docs/1.1.0/installation) or the [latest installation guide](/docs/installation). | ||
``` | ||
|
||
--- | ||
|
@@ -288,9 +288,9 @@ Check our [installation guide for v1.0](/docs/1.0/installation) or the [latest i | |
label: '2.0', | ||
path: '2.0', | ||
}, | ||
'1.0': { | ||
label: '1.0 (Legacy)', | ||
path: '1.0', | ||
'1.1.0': { | ||
label: '1.1.0 (Legacy)', | ||
path: '1.1.0', | ||
banner: 'unmaintained', // Adds a banner indicating this version is no longer maintained | ||
}, | ||
}, | ||
|
@@ -305,25 +305,25 @@ Check our [installation guide for v1.0](/docs/1.0/installation) or the [latest i | |
|
||
## 7. Example Scenario | ||
|
||
Let's walk through versioning for a software project with two releases: 1.0 and 2.0. | ||
Let's walk through versioning for a software project with two releases: 1.1.0 and 2.0. | ||
|
||
```bash | ||
# File: terminal commands for versioning workflow | ||
# Initial setup - create version 1.0 | ||
npm run docusaurus docs:version 1.0 | ||
# Initial setup - create version 1.1.0 | ||
npm run docusaurus docs:version 1.1.0 | ||
|
||
# Result: | ||
# - versioned_docs/version-1.0/ contains a snapshot of docs/ | ||
# - versioned_sidebars/version-1.0-sidebars.json is created | ||
# - versions.json now includes "1.0" | ||
# - versioned_docs/version-1.1.0/ contains a snapshot of docs/ | ||
# - versioned_sidebars/version-1.1.0-sidebars.json is created | ||
# - versions.json now includes "1.1.0" | ||
|
||
# Later - update docs/ with changes for version 2.0 and create version 2.0 | ||
npm run docusaurus docs:version 2.0 | ||
|
||
# Result: | ||
# - versioned_docs/version-2.0/ is created | ||
# - versioned_sidebars/version-2.0-sidebars.json is created | ||
# - versions.json now includes "2.0" and "1.0" | ||
# - versions.json now includes "2.0" and "1.1.0" | ||
# - docs/ becomes the "Next" version | ||
``` | ||
|
||
|
@@ -335,7 +335,7 @@ my-docusaurus-project/ | |
├── docs/ # Current "Next" version | ||
├── versioned_docs/ | ||
│ ├── version-2.0/ # Version 2.0 documentation | ||
│ └── version-1.0/ # Version 1.0 documentation | ||
│ └── version-1.1.0/ # Version 1.1.0 documentation | ||
├── versioned_sidebars/ | ||
│ ├── version-2.0-sidebars.json | ||
│ └── version-1.0-sidebars.json | ||
|
@@ -346,7 +346,7 @@ The result is a site where users can easily navigate between versions through th | |
|
||
- **Next**: Latest unreleased changes | ||
- **2.0**: Documentation for version 2.0 | ||
- **1.0 (Legacy)**: Documentation for version 1.0 | ||
- **1.1.0 (Legacy)**: Documentation for version 1.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
--- | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LiZhenCheng9527 @AkarshSahlot What's the influence, i am not familiar with this part