diff --git a/docs/talos/reference/cli/sidebar.ts b/docs/talos/reference/cli/sidebar.ts new file mode 100644 index 000000000..97185c68c --- /dev/null +++ b/docs/talos/reference/cli/sidebar.ts @@ -0,0 +1,95 @@ +// Hand-maintained navigation tree for the auto-generated Talos CLI reference. +// +// The CLI docs (talos-*.md in this directory) are generated from Cobra and ship +// without a sidebar, so this file mirrors the `talos --help` command hierarchy. +// When commands are added/removed, update this tree to match the generated pages. +// +// Imported by sidebars-oss.ts and sidebars-oel.ts and rendered as the +// "CLI reference" category (linked to the root `talos` command page). +const id = (name: string) => `talos/reference/cli/${name}` + +const talosCliReference = { + type: "category", + label: "CLI reference", + link: { type: "doc", id: id("talos") }, + items: [ + { + type: "category", + label: "talos jwk", + link: { type: "doc", id: id("talos-jwk") }, + items: [ + { + type: "category", + label: "talos jwk generate", + link: { type: "doc", id: id("talos-jwk-generate") }, + items: [ + id("talos-jwk-generate-ecdsa"), + id("talos-jwk-generate-eddsa"), + id("talos-jwk-generate-hmac"), + id("talos-jwk-generate-rsa"), + ], + }, + id("talos-jwk-get"), + ], + }, + { + type: "category", + label: "talos keys", + link: { type: "doc", id: id("talos-keys") }, + items: [ + id("talos-keys-issue"), + id("talos-keys-verify"), + id("talos-keys-batch-verify"), + id("talos-keys-derive-token"), + id("talos-keys-self-revoke"), + { + type: "category", + label: "talos keys issued", + link: { type: "doc", id: id("talos-keys-issued") }, + items: [ + id("talos-keys-issued-issue"), + id("talos-keys-issued-get"), + id("talos-keys-issued-list"), + id("talos-keys-issued-update"), + id("talos-keys-issued-rotate"), + id("talos-keys-issued-revoke"), + ], + }, + { + type: "category", + label: "talos keys imported", + link: { type: "doc", id: id("talos-keys-imported") }, + items: [ + id("talos-keys-imported-import"), + id("talos-keys-imported-batch-import"), + id("talos-keys-imported-get"), + id("talos-keys-imported-list"), + id("talos-keys-imported-update"), + id("talos-keys-imported-revoke"), + id("talos-keys-imported-delete"), + ], + }, + ], + }, + { + type: "category", + label: "talos migrate", + link: { type: "doc", id: id("talos-migrate") }, + items: [ + id("talos-migrate-up"), + id("talos-migrate-down"), + id("talos-migrate-status"), + id("talos-migrate-force"), + ], + }, + id("talos-proxy"), + { + type: "category", + label: "talos serve", + link: { type: "doc", id: id("talos-serve") }, + items: [id("talos-serve-public"), id("talos-serve-admin")], + }, + ], +} + +export default talosCliReference diff --git a/sidebars-oel.ts b/sidebars-oel.ts index e5d194c13..e9bf9182e 100644 --- a/sidebars-oel.ts +++ b/sidebars-oel.ts @@ -2,9 +2,25 @@ import { SidebarItem, SidebarItemConfig, } from "@docusaurus/plugin-content-docs/src/sidebars/types" +import talosApiSidebar from "./docs/talos/reference/api/sidebar" +import talosCliReference from "./docs/talos/reference/cli/sidebar" type SidebarItemsConfig = SidebarItemConfig[] +// The generated Talos API sidebar is [overview doc, { category "ApiKeys", items: [...methods] }]. +// Lift the methods into a single "API reference" category linked to the overview page so the +// navigation reads cleanly instead of exposing the raw OpenAPI tag name. +const talosApiReference = { + type: "category", + label: "API reference", + link: { type: "doc", id: "talos/reference/api/ory-talos-api" }, + items: talosApiSidebar.flatMap((item: any) => + typeof item === "object" && "items" in item && Array.isArray(item.items) + ? item.items + : [], + ), +} + const oelSidebar = [ { type: "category", @@ -576,8 +592,8 @@ const oelSidebar = [ label: "Reference", items: [ "talos/reference/index", - "talos/reference/api/ory-talos-api", - "talos/reference/cli/talos", + talosApiReference, + talosCliReference, "talos/reference/config", "talos/reference/token-format", "talos/reference/events", diff --git a/sidebars-oss.ts b/sidebars-oss.ts index dd5fc2db8..6f6ae58d1 100644 --- a/sidebars-oss.ts +++ b/sidebars-oss.ts @@ -1,3 +1,20 @@ +import talosApiSidebar from "./docs/talos/reference/api/sidebar" +import talosCliReference from "./docs/talos/reference/cli/sidebar" + +// The generated Talos API sidebar is [overview doc, { category "ApiKeys", items: [...methods] }]. +// Lift the methods into a single "API reference" category linked to the overview page so the +// navigation reads cleanly instead of exposing the raw OpenAPI tag name. +const talosApiReference = { + type: "category", + label: "API reference", + link: { type: "doc", id: "talos/reference/api/ory-talos-api" }, + items: talosApiSidebar.flatMap((item: any) => + typeof item === "object" && "items" in item && Array.isArray(item.items) + ? item.items + : [], + ), +} + const ossSidebar = [ { type: "category", @@ -582,8 +599,8 @@ const ossSidebar = [ label: "Reference", items: [ "talos/reference/index", - "talos/reference/api/ory-talos-api", - "talos/reference/cli/talos", + talosApiReference, + talosCliReference, "talos/reference/config", "talos/reference/token-format", "talos/reference/events",