Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,20 @@ served as `latest` at `/docs`; the editable current docs are served at `/docs/ne
When releasing, snapshot the current docs:

```bash
npm run docusaurus docs:version <release-version>
npm run version -- <release-version>
```

This creates:
- `versioned_docs/version-<release-version>/` - Frozen snapshot
- Updates `versions.json`
- Validates the generated versioned docs with a production Docusaurus build

`docusaurus.config.ts` reads `versions.json` automatically, so release updates
should not require editing the Docusaurus version configuration.

The command runs the documentation sync first, so generated Python API reference
pages are included in the version snapshot before the local build validation.

## Blog Posts

Blog posts live in `website/blog/`:
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
"version": "docusaurus docs:version"
"version": "node scripts/version-docs.js"
},
"dependencies": {
"@docusaurus/core": "3.10.1",
Expand Down
58 changes: 58 additions & 0 deletions website/scripts/version-docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env node

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const { spawnSync } = require('child_process');

function usage() {
console.error('Usage: npm run version -- <release-version>');
console.error('');
console.error('Example: npm run version -- 0.7');
}

function run(command, args) {
const result = spawnSync(command, args, {
cwd: process.cwd(),
stdio: 'inherit',
shell: process.platform === 'win32',
});

if (result.error) {
throw result.error;
}

if (result.status !== 0) {
process.exit(result.status);
}
}

function main() {
const version = process.argv[2];

if (!version || version.startsWith('-')) {
usage();
process.exit(1);
}

console.log(`Preparing versioned docs for ${version}...`);
run('npm', ['run', 'sync']);
run('npm', ['run', 'docusaurus', '--', 'docs:version', version]);
run('npm', ['run', 'build']);
}

main();
Loading