Skip to content

Commit 0533f43

Browse files
authored
Check in versioned docs and remove generate-versions script (#1386)
* Check in versioned docs and remove generate-versions script Transition from per-branch versioning to all versions checked in. Generated versioned docs from release branches 1.5 through 1.11. Removed generate-versions.sh and updated .gitignore. * Remove generate-versions script from build workflow Versioned docs are now checked in directly. Remove the script invocation from package.json build, drop the fetch-depth: 0 from CI (no longer needed), and update README to reflect the new process.
1 parent f300ec0 commit 0533f43

1,848 files changed

Lines changed: 225745 additions & 163 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_and_publish.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
pull-requests: write
2525
steps:
2626
- uses: actions/checkout@v4
27-
with:
28-
fetch-depth: 0 # Fetch all history for all branches (needed for versioned docs)
2927

3028
- uses: actions/setup-node@v4
3129
with:

website/.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
.docusaurus
99
.cache-loader
1010

11-
# Generated versioned docs (created by scripts/generate-versions.sh)
12-
/versioned_docs
13-
/versioned_sidebars
14-
# Note: versions.json is now manually managed and should be committed
15-
1611
# Misc
1712
.DS_Store
1813
.env.local

website/README.md

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,64 +24,35 @@ During local development, only the current docs (in the `docs/` folder) are serv
2424
npm run build
2525
```
2626

27-
This command generates versioned docs from git refs, then builds static content into the `build` directory.
28-
29-
To build without generating versions (uses only the current `docs/` folder):
30-
31-
```bash
32-
npm run build:local
33-
```
27+
This command builds static content into the `build` directory.
3428

3529
## Versioned Documentation
3630

37-
The documentation supports multiple versions to maintain docs for different releases. Versioned docs are generated at build time from git release branches to avoid maintaining duplicate content in the repository.
31+
The documentation supports multiple versions to maintain docs for different releases. Versioned docs are checked into the repository under `versioned_docs/` and `versioned_sidebars/`.
3832

3933
### How it works
4034

4135
1. **Current docs** (`docs/`) — Working documentation from trunk, served at `/docs/trunk`
42-
2. **Versioned docs** — Auto-generated at build time from `release/<major>.<minor>` branches
43-
- Highest version (e.g., v2.0.x) → "Next" (unreleased) at `/docs/next`
44-
- Second highest (e.g., v1.11.x) → "Latest" (stable) at `/docs`
45-
- Previous versions → at `/docs/v1.10`, etc.
46-
47-
The version generation script ([scripts/generate-versions.sh](scripts/generate-versions.sh)) auto-detects release branches and uses `git archive` to extract docs from each without checking out the full repository.
36+
2. **Versioned docs** (`versioned_docs/`) — Checked-in snapshots from release branches
37+
- Listed in `versions.json` in order from newest to oldest
38+
- Latest version serves at `/docs`
39+
- Previous versions serve at `/docs/v1.10`, etc.
4840

4941
### Creating a new version for a release
5042

5143
When releasing a new version (e.g., v2.1):
5244

53-
1. **Create a release branch** for the new version:
54-
55-
```bash
56-
git checkout -b release/2.1
57-
git push origin release/2.1
58-
```
59-
60-
2. **That's it!** The build script auto-detects release branches matching the `release/<major>.<minor>` pattern. The next build will automatically include the new version.
61-
62-
3. **Test the build locally**:
63-
64-
```bash
65-
npm run build
66-
npm run serve
67-
```
45+
1. Copy the current `docs/` directory to `versioned_docs/version-2.1.x/`
46+
2. Add `"2.1.x"` to the beginning of `versions.json`
47+
3. Create a matching sidebar file at `versioned_sidebars/version-2.1.x-sidebars.json`
48+
4. Commit and push the changes
6849

6950
### Version URL structure
7051

7152
- `/docs` — Latest stable release (default)
72-
- `/docs/next` — Next release (unreleased, highest version branch)
7353
- `/docs/trunk` — Working docs from trunk
7454
- `/docs/v1.10` — Previous release versions
7555

7656
### Updating existing version docs
7757

78-
To update docs for a released version, push changes directly to the corresponding release branch:
79-
80-
```bash
81-
git checkout release/2.1
82-
# Make changes
83-
git commit -m "Update docs for v2.1.x"
84-
git push origin release/2.1
85-
```
86-
87-
The next build will pick up the updated docs from the release branch.
58+
To update docs for a released version, edit the files directly in the corresponding `versioned_docs/version-<version>/` directory and commit the changes.

website/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"scripts": {
66
"docusaurus": "docusaurus",
77
"start": "docusaurus start",
8-
"build": "./scripts/generate-versions.sh && docusaurus build",
9-
"build:local": "docusaurus build",
10-
"generate-versions": "./scripts/generate-versions.sh",
8+
"build": "docusaurus build",
119
"swizzle": "docusaurus swizzle",
1210
"deploy": "docusaurus deploy",
1311
"clear": "docusaurus clear",

website/scripts/generate-versions.sh

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)