mirror of
https://github.com/docker/docs.git
synced 2026-03-27 06:18:55 +07:00
chore: move cli data files to data subdir
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
2
.github/workflows/validate-upstream.yml
vendored
2
.github/workflows/validate-upstream.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
||||
const yamlSrcFilename = path.basename(yamlSrcPath);
|
||||
const yamlSrcNoExt = yamlSrcPath.replace(".yaml", "");
|
||||
const hasSubCommands = (await (await glob.create(yamlSrcNoExt)).glob()).length > 1;
|
||||
const yamlDestPath = path.join('data', `${{ inputs.data-files-folder }}`, yamlSrcFilename);
|
||||
const yamlDestPath = path.join('data', 'cli', `${{ inputs.data-files-folder }}`, yamlSrcFilename);
|
||||
let placeholderPath = path.join("content/reference/cli", yamlSrcFilename.replace('_', '/').replace(/\.yaml$/, '.md'));
|
||||
if (hasSubCommands) {
|
||||
placeholderPath = placeholderPath.replace('.md', '/_index.md');
|
||||
|
||||
@@ -18,48 +18,40 @@
|
||||
so they still appear in the sidebar navigation.
|
||||
*/ -}}
|
||||
|
||||
{{- $folders := slice
|
||||
"engine-cli" "buildx" "compose-cli" "model-cli" "mcp-cli"
|
||||
"sandbox-cli" "offload-cli" "scout-cli" "desktop-cli"
|
||||
"init-cli" "debug-cli" "secrets-engine"
|
||||
-}}
|
||||
{{- range $folder, $files := site.Data.cli -}}
|
||||
{{- range $name, $data := $files -}}
|
||||
{{- /* Skip hidden commands */ -}}
|
||||
{{- if $data.hidden -}}
|
||||
{{- continue -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $folder := $folders -}}
|
||||
{{- with index site.Data $folder -}}
|
||||
{{- range $name, $data := . -}}
|
||||
{{- /* Skip hidden commands */ -}}
|
||||
{{- if $data.hidden -}}
|
||||
{{- continue -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Skip alias/shortcut commands: if any alias has more words than
|
||||
the command, a longer canonical form exists elsewhere. */ -}}
|
||||
{{- $cmdWords := len (split $data.command " ") -}}
|
||||
{{- $isAlias := false -}}
|
||||
{{- with $data.aliases -}}
|
||||
{{- range (split . ", ") -}}
|
||||
{{- if gt (len (split . " ")) $cmdWords -}}
|
||||
{{- $isAlias = true -}}
|
||||
{{- end -}}
|
||||
{{- /* Skip alias/shortcut commands: if any alias has more words than
|
||||
the command, a longer canonical form exists elsewhere. */ -}}
|
||||
{{- $cmdWords := len (split $data.command " ") -}}
|
||||
{{- $isAlias := false -}}
|
||||
{{- with $data.aliases -}}
|
||||
{{- range (split . ", ") -}}
|
||||
{{- if gt (len (split . " ")) $cmdWords -}}
|
||||
{{- $isAlias = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $isAlias -}}
|
||||
{{- continue -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $path := replace $data.command " " "/" -}}
|
||||
{{- $kind := "page" -}}
|
||||
{{- with $data.cname -}}
|
||||
{{- $kind = "section" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $.AddPage (dict
|
||||
"path" $path
|
||||
"title" $data.command
|
||||
"kind" $kind
|
||||
"params" (dict "datafolder" $folder "datafile" $name)
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- if $isAlias -}}
|
||||
{{- continue -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $path := replace $data.command " " "/" -}}
|
||||
{{- $kind := "page" -}}
|
||||
{{- with $data.cname -}}
|
||||
{{- $kind = "section" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $.AddPage (dict
|
||||
"path" $path
|
||||
"title" $data.command
|
||||
"kind" $kind
|
||||
"params" (dict "datafolder" $folder "datafile" $name)
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user