You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer-guide/website/versioning-doc.md
+34-34Lines changed: 34 additions & 34 deletions
Display the source diff
Display the rich diff
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
14
14
Docusaurus provides a straightforward system for versioning documentation:
15
15
16
16
-**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.
17
-
-**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.
17
+
-**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.
18
18
19
19
For example:
20
20
@@ -23,10 +23,10 @@ For example:
23
23
my-docusaurus-project/
24
24
├── docs/ # Current version documentation
25
25
├── versioned_docs/ # All versioned documentation
26
-
│ ├── version-1.0/ # Version 1.0 documentation
26
+
│ ├── version-1.1.0/ # Version 1.1.0 documentation
27
27
│ └── version-1.1/ # Version 1.1 documentation
28
28
├── versioned_sidebars/ # Sidebars for each version
29
-
│ ├── version-1.0-sidebars.json
29
+
│ ├── version-1.1.0-sidebars.json
30
30
│ └── version-1.1-sidebars.json
31
31
└── versions.json # List of all available versions
32
32
```
@@ -57,24 +57,24 @@ or
57
57
yarn docusaurus docs:version <version>
58
58
```
59
59
60
-
Replace `<version>` with your desired version number, e.g., `1.0`.
60
+
Replace `<version>` with your desired version number, e.g., `1.1.0`.
61
61
62
62
-**What Happens**:
63
-
- Docusaurus duplicates the entire `docs/` folder into `versioned_docs/version-1.0/`.
63
+
- Docusaurus duplicates the entire `docs/` folder into `versioned_docs/version-1.1.0/`.
64
64
- It updates the `versions.json` file, which tracks all versioned documentation.
65
65
66
-
Example `versions.json` after creating version 1.0:
66
+
Example `versions.json` after creating version 1.1.0:
67
67
68
68
```json
69
69
// File: versions.json
70
70
[
71
-
"1.0"
71
+
"1.1.0"
72
72
]
73
73
```
74
74
75
75
### Step 2: Customize Version Labels
76
76
77
-
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`:
77
+
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`:
78
78
79
79
```javascript
80
80
// File: docusaurus.config.js
@@ -85,7 +85,7 @@ module.exports = {
85
85
docs: {
86
86
sidebar: {
87
87
versionLabels: {
88
-
'1.0':'Version 1.0 (Legacy)',
88
+
'1.1.0':'Version 1.1.0 (Legacy)',
89
89
'1.1':'Version 1.1',
90
90
'current':'Next (Unreleased)'
91
91
},
@@ -125,7 +125,7 @@ This creates a new snapshot in `versioned_docs/version-2.0/` and updates `versio
0 commit comments