Skip to content

Commit 927789c

Browse files
authored
fix: wire Talos API and CLI reference sidebars to show all methods (#2604)
1 parent fa193db commit 927789c

3 files changed

Lines changed: 132 additions & 4 deletions

File tree

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Hand-maintained navigation tree for the auto-generated Talos CLI reference.
2+
//
3+
// The CLI docs (talos-*.md in this directory) are generated from Cobra and ship
4+
// without a sidebar, so this file mirrors the `talos --help` command hierarchy.
5+
// When commands are added/removed, update this tree to match the generated pages.
6+
//
7+
// Imported by sidebars-oss.ts and sidebars-oel.ts and rendered as the
8+
// "CLI reference" category (linked to the root `talos` command page).
9+
const id = (name: string) => `talos/reference/cli/${name}`
10+
11+
const talosCliReference = {
12+
type: "category",
13+
label: "CLI reference",
14+
link: { type: "doc", id: id("talos") },
15+
items: [
16+
{
17+
type: "category",
18+
label: "talos jwk",
19+
link: { type: "doc", id: id("talos-jwk") },
20+
items: [
21+
{
22+
type: "category",
23+
label: "talos jwk generate",
24+
link: { type: "doc", id: id("talos-jwk-generate") },
25+
items: [
26+
id("talos-jwk-generate-ecdsa"),
27+
id("talos-jwk-generate-eddsa"),
28+
id("talos-jwk-generate-hmac"),
29+
id("talos-jwk-generate-rsa"),
30+
],
31+
},
32+
id("talos-jwk-get"),
33+
],
34+
},
35+
{
36+
type: "category",
37+
label: "talos keys",
38+
link: { type: "doc", id: id("talos-keys") },
39+
items: [
40+
id("talos-keys-issue"),
41+
id("talos-keys-verify"),
42+
id("talos-keys-batch-verify"),
43+
id("talos-keys-derive-token"),
44+
id("talos-keys-self-revoke"),
45+
{
46+
type: "category",
47+
label: "talos keys issued",
48+
link: { type: "doc", id: id("talos-keys-issued") },
49+
items: [
50+
id("talos-keys-issued-issue"),
51+
id("talos-keys-issued-get"),
52+
id("talos-keys-issued-list"),
53+
id("talos-keys-issued-update"),
54+
id("talos-keys-issued-rotate"),
55+
id("talos-keys-issued-revoke"),
56+
],
57+
},
58+
{
59+
type: "category",
60+
label: "talos keys imported",
61+
link: { type: "doc", id: id("talos-keys-imported") },
62+
items: [
63+
id("talos-keys-imported-import"),
64+
id("talos-keys-imported-batch-import"),
65+
id("talos-keys-imported-get"),
66+
id("talos-keys-imported-list"),
67+
id("talos-keys-imported-update"),
68+
id("talos-keys-imported-revoke"),
69+
id("talos-keys-imported-delete"),
70+
],
71+
},
72+
],
73+
},
74+
{
75+
type: "category",
76+
label: "talos migrate",
77+
link: { type: "doc", id: id("talos-migrate") },
78+
items: [
79+
id("talos-migrate-up"),
80+
id("talos-migrate-down"),
81+
id("talos-migrate-status"),
82+
id("talos-migrate-force"),
83+
],
84+
},
85+
id("talos-proxy"),
86+
{
87+
type: "category",
88+
label: "talos serve",
89+
link: { type: "doc", id: id("talos-serve") },
90+
items: [id("talos-serve-public"), id("talos-serve-admin")],
91+
},
92+
],
93+
}
94+
95+
export default talosCliReference

sidebars-oel.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,25 @@ import {
22
SidebarItem,
33
SidebarItemConfig,
44
} from "@docusaurus/plugin-content-docs/src/sidebars/types"
5+
import talosApiSidebar from "./docs/talos/reference/api/sidebar"
6+
import talosCliReference from "./docs/talos/reference/cli/sidebar"
57

68
type SidebarItemsConfig = SidebarItemConfig[]
79

10+
// The generated Talos API sidebar is [overview doc, { category "ApiKeys", items: [...methods] }].
11+
// Lift the methods into a single "API reference" category linked to the overview page so the
12+
// navigation reads cleanly instead of exposing the raw OpenAPI tag name.
13+
const talosApiReference = {
14+
type: "category",
15+
label: "API reference",
16+
link: { type: "doc", id: "talos/reference/api/ory-talos-api" },
17+
items: talosApiSidebar.flatMap((item: any) =>
18+
typeof item === "object" && "items" in item && Array.isArray(item.items)
19+
? item.items
20+
: [],
21+
),
22+
}
23+
824
const oelSidebar = [
925
{
1026
type: "category",
@@ -576,8 +592,8 @@ const oelSidebar = [
576592
label: "Reference",
577593
items: [
578594
"talos/reference/index",
579-
"talos/reference/api/ory-talos-api",
580-
"talos/reference/cli/talos",
595+
talosApiReference,
596+
talosCliReference,
581597
"talos/reference/config",
582598
"talos/reference/token-format",
583599
"talos/reference/events",

sidebars-oss.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
import talosApiSidebar from "./docs/talos/reference/api/sidebar"
2+
import talosCliReference from "./docs/talos/reference/cli/sidebar"
3+
4+
// The generated Talos API sidebar is [overview doc, { category "ApiKeys", items: [...methods] }].
5+
// Lift the methods into a single "API reference" category linked to the overview page so the
6+
// navigation reads cleanly instead of exposing the raw OpenAPI tag name.
7+
const talosApiReference = {
8+
type: "category",
9+
label: "API reference",
10+
link: { type: "doc", id: "talos/reference/api/ory-talos-api" },
11+
items: talosApiSidebar.flatMap((item: any) =>
12+
typeof item === "object" && "items" in item && Array.isArray(item.items)
13+
? item.items
14+
: [],
15+
),
16+
}
17+
118
const ossSidebar = [
219
{
320
type: "category",
@@ -582,8 +599,8 @@ const ossSidebar = [
582599
label: "Reference",
583600
items: [
584601
"talos/reference/index",
585-
"talos/reference/api/ory-talos-api",
586-
"talos/reference/cli/talos",
602+
talosApiReference,
603+
talosCliReference,
587604
"talos/reference/config",
588605
"talos/reference/token-format",
589606
"talos/reference/events",

0 commit comments

Comments
 (0)