- Finalize and review all updates in the
docs/folder (Next Release). - Ensure images, videos, and assets are correctly linked.
- Run a local build (
pnpm run build) to check for errors.
Run the following command:
npx docusaurus docs:version <version>Example:
npx docusaurus docs:version 4.4.0Verify the following are created:
versioned_docs/version-<version>/versioned_sidebars/version-<version>-sidebars.jsonversions.jsonis updated.
- Manually create a folder under
/static/versioned/<version>/. - Inside it, recreate subdirectories for each type of asset (e.g.
img,demos,pdf, etc.). - Copy all referenced static files from
/static/into the matching paths under/static/versioned/<version>/.
Run the custom path update script to adjust all links inside versioned_docs/:
- Replace relative static links (e.g.,
../../static/...) - With versioned paths (e.g.,
../versioned/<version>/img/...).
Verify all updated paths resolve correctly in the browser.
In docusaurus.config.js, add the new version entry under versions: {} with:
- Correct label (e.g.
"4.4.0") - Banner setting as
"none" - Ensure current (Next Release) remains active for ongoing work.
Run:
pnpm run clear && pnpm run buildVerify:
- Both the new version and the Next Release appear in the dropdown.
- All media and image files render correctly.
In order to rewrite URLs for APIs based on client needs we need to copy the OAS file for versioning.
- Copy/Create a Spec file for the version.
- Add new configuration for the version in the docusaurus-plugin-openapi-docs plugin
Example
plugins: [
[
require.resolve("docusaurus-plugin-openapi-docs"),
{
id: "openapi-reactor",
docsPluginId: "classic",
config: {
next: {
//specPath: "https://raw.githubusercontent.com/SEMOSS/Monolith/refs/heads/swagger-feature/swagger-ui/swagger.json",
specPath: "examples/semoss-api-spec.json",
disableCompression: true,
outputDir: "docs/developer/ai-core-api",
sidebarOptions: {
groupPathsBy: "tag",
},
//infoTemplate: "templates/info.mustache",
},
v5_0: {
specPath: "examples/semoss-api-spec5.json",
disableCompression: true,
outputDir: "versioned_docs/version-5.0.0/developer/ai-core-api",
sidebarOptions: {
groupPathsBy: "tag",
},
},
v4_3: {
specPath: "examples/semoss-api-spec4.json",
disableCompression: true,
outputDir: "versioned_docs/version-4.3.2/ai-core-api",
sidebarOptions: {
groupPathsBy: "tag",
},
},
},
},
],
]- Commit the updated
versioned_docs/,static/versioned/, and config files. - Push changes to the main branch.
- Deploy or publish as per project workflow.