|
18 | 18 | so they still appear in the sidebar navigation. |
19 | 19 | */ -}} |
20 | 20 |
|
21 | | -{{- $folders := slice |
22 | | - "engine-cli" "buildx" "compose-cli" "model-cli" "mcp-cli" |
23 | | - "sandbox-cli" "offload-cli" "scout-cli" "desktop-cli" |
24 | | - "init-cli" "debug-cli" "secrets-engine" |
25 | | --}} |
26 | | - |
27 | | -{{- range $folder := $folders -}} |
28 | | - {{- with index site.Data $folder -}} |
29 | | - {{- range $name, $data := . -}} |
30 | | - {{- /* Skip hidden commands */ -}} |
31 | | - {{- if $data.hidden -}} |
32 | | - {{- continue -}} |
33 | | - {{- end -}} |
| 21 | +{{- range $folder, $files := site.Data.cli -}} |
| 22 | + {{- range $name, $data := $files -}} |
| 23 | + {{- /* Skip hidden commands */ -}} |
| 24 | + {{- if $data.hidden -}} |
| 25 | + {{- continue -}} |
| 26 | + {{- end -}} |
34 | 27 |
|
35 | | - {{- /* Skip alias/shortcut commands: if any alias has more words than |
36 | | - the command, a longer canonical form exists elsewhere. */ -}} |
37 | | - {{- $cmdWords := len (split $data.command " ") -}} |
38 | | - {{- $isAlias := false -}} |
39 | | - {{- with $data.aliases -}} |
40 | | - {{- range (split . ", ") -}} |
41 | | - {{- if gt (len (split . " ")) $cmdWords -}} |
42 | | - {{- $isAlias = true -}} |
43 | | - {{- end -}} |
| 28 | + {{- /* Skip alias/shortcut commands: if any alias has more words than |
| 29 | + the command, a longer canonical form exists elsewhere. */ -}} |
| 30 | + {{- $cmdWords := len (split $data.command " ") -}} |
| 31 | + {{- $isAlias := false -}} |
| 32 | + {{- with $data.aliases -}} |
| 33 | + {{- range (split . ", ") -}} |
| 34 | + {{- if gt (len (split . " ")) $cmdWords -}} |
| 35 | + {{- $isAlias = true -}} |
44 | 36 | {{- end -}} |
45 | 37 | {{- end -}} |
46 | | - {{- if $isAlias -}} |
47 | | - {{- continue -}} |
48 | | - {{- end -}} |
49 | | - |
50 | | - {{- $path := replace $data.command " " "/" -}} |
51 | | - {{- $kind := "page" -}} |
52 | | - {{- with $data.cname -}} |
53 | | - {{- $kind = "section" -}} |
54 | | - {{- end -}} |
| 38 | + {{- end -}} |
| 39 | + {{- if $isAlias -}} |
| 40 | + {{- continue -}} |
| 41 | + {{- end -}} |
55 | 42 |
|
56 | | - {{- $.AddPage (dict |
57 | | - "path" $path |
58 | | - "title" $data.command |
59 | | - "kind" $kind |
60 | | - "params" (dict "datafolder" $folder "datafile" $name) |
61 | | - ) -}} |
| 43 | + {{- $path := replace $data.command " " "/" -}} |
| 44 | + {{- $kind := "page" -}} |
| 45 | + {{- with $data.cname -}} |
| 46 | + {{- $kind = "section" -}} |
62 | 47 | {{- end -}} |
| 48 | + |
| 49 | + {{- $.AddPage (dict |
| 50 | + "path" $path |
| 51 | + "title" $data.command |
| 52 | + "kind" $kind |
| 53 | + "params" (dict "datafolder" $folder "datafile" $name) |
| 54 | + ) -}} |
63 | 55 | {{- end -}} |
64 | 56 | {{- end -}} |
65 | 57 |
|
|
0 commit comments