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
75 changes: 50 additions & 25 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
import fs from 'node:fs';
import path from 'node:path';
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

// === Versioning ===
// The version map is derived from versions.json, which `docusaurus docs:version`
// writes newest-first. Cutting the next release therefore needs only the snapshot
// plus that file — no edit here, and no version hard-coded in this config.
//
// the newest release -> /docs/* labelled "vX.Y (latest)"
// an older release -> /docs/X.Y/* labelled "vX.Y"
// the docs/ folder -> /docs/dev/* labelled "dev", synced from rossoctl/rossoctl
//
// docs/ is NOT committed here: scripts/sync-docs.sh mirrors it from
// rossoctl/rossoctl on every build, so "dev" always matches that repo 1:1.
const versionsFile = path.join(__dirname, 'versions.json');
const releasedVersions: string[] = fs.existsSync(versionsFile)
? JSON.parse(fs.readFileSync(versionsFile, 'utf8'))
: [];
const LATEST_VERSION = releasedVersions[0];

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

const config: Config = {
Expand Down Expand Up @@ -79,11 +98,30 @@ const config: Config = {
'authbridge/**',
'automation-health.md',
],
versions: {
current: {
label: 'dev',
},
},
...(LATEST_VERSION
? {
// The newest release is the default at /docs.
lastVersion: LATEST_VERSION,
versions: {
// Released versions first, then the unreleased "dev" version —
// this object order is the version dropdown order.
...Object.fromEntries(
releasedVersions.map((v) => [
v,
{
label: v === LATEST_VERSION ? `v${v} (latest)` : `v${v}`,
path: v === LATEST_VERSION ? '' : v,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (for the v0.8 timeline, not this PR) — This line is the mechanism that relocates a version when a newer one is cut: path: '' for the latest, path: v for everything older. Correct, and the right default.

Worth planning for the consequence now rather than discovering it then. When v0.8 is cut, today's 27 URLs (/docs/getting-started/install, etc.) start serving v0.8 content, and the v0.7 content moves to /docs/0.7/getting-started/install. External links, bookmarks, and search results pointing at /docs/* will silently retarget to newer content rather than 404 — usually fine, occasionally not (a link shared in an issue thread as "how to install on 0.7" quietly becomes about 0.8).

If you want those to land on the version they were written against, that needs @docusaurus/plugin-client-redirects configured at v0.8 time. Nothing to change here; just much cheaper to decide before the cut than to retrofit after.

badge: true,
},
]),
),
current: {label: 'dev', path: 'dev', banner: 'unreleased'},
},
}
: {
// Before the first version is cut, docs/ is the only version.
versions: {current: {label: 'dev'}},
}),
},
// Blog is an EXTERNAL Medium link (see navbar) — no local blog.
blog: false,
Expand Down Expand Up @@ -184,27 +222,14 @@ const config: Config = {
target: '_blank',
rel: 'noopener noreferrer',
},
// === TEMPORARY: "dev" version dropdown hidden until docs go public. ===
// It only links into /docs/*, so it's removed while docs are unpublished.
// TO RESTORE: uncomment this item (requires re-enabling `docs` in the preset above).
/* {
// Docs version selector, on the left after Blog. Rendered as an
// explicit dropdown (caret + menu) because Docusaurus collapses its
// built-in `docsVersionDropdown` to a plain link while only one
// version exists. Selecting "dev" opens the first docs page
// (Getting Started). When v0.7 is cut, replace this with
// `{ type: 'docsVersionDropdown', position: 'left' }` — it will then
// auto-list v0.7 (latest) and dev.
type: 'dropdown',
label: 'dev',
{
// Docs version selector. Lists the released versions newest-first, then
// the unreleased "dev" version, matching the order in the preset above.
type: 'docsVersionDropdown',
position: 'left',
items: [
{
label: 'dev',
to: '/docs/category/getting-started',
},
],
}, */
dropdownActiveClassDisabled: true,
versions: [...releasedVersions, 'current'],
},
{
// Live GitHub star count (icon + "N stars"), fetched client-side.
// See src/components/GitHubStars + theme/NavbarItem/ComponentTypes.
Expand Down
Binary file not shown.
9 changes: 9 additions & 0 deletions versioned_docs/version-0.7/concepts/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "Concepts",
"position": 3,
"description": "Understand Rossoctl's platform and security model.",
"link": {
"type": "generated-index",
"description": "Understand Rossoctl's platform and security model."
}
}
91 changes: 91 additions & 0 deletions versioned_docs/version-0.7/concepts/architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions versioned_docs/version-0.7/concepts/authbridge-architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions versioned_docs/version-0.7/concepts/authorization-pattern.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading