diff --git a/content/docs/reference/command/commands.cue b/content/docs/reference/command/commands.cue index 0f58044f39..5768e4838d 100644 --- a/content/docs/reference/command/commands.cue +++ b/content/docs/reference/command/commands.cue @@ -19,6 +19,7 @@ _cuePathBase: { cuePath!: string tagSet!: [string]: true // true is chosen over top purely to produce concrete data. tagList!: [...] + relatedCommands!: [...string] // oldDir is used to populate the page-level "aliases" front matter key, // temporarily, until our logs show us that few enough inbound links reach @@ -35,6 +36,7 @@ cue: [SubCommand=string]: #CueCommand & { oldDir: *"cue-\(_dirSuffix)" | _ tagSet: *{} | _ tagList: [for tag, _ in tagSet {tag}] + relatedCommands: *[] | _ cuePath: json.Marshal(_cuePathBase & { _input: dir }) @@ -75,6 +77,37 @@ tags: cue: { ] } +// Related "docs/reference/command/" pages, manually extracted from help text +// contents. +cue: { + mod: relatedCommands: [ + "cue help modules", + "cue help mod edit", + "cue help mod fix", + "cue help mod get", + "cue help mod init", + "cue help mod publish", + "cue help mod resolve", + "cue help mod tidy", + ] + "mod get": relatedCommands: [ + "cue help environment", + ] + "mod publish": relatedCommands: [ + "cue help environment", + ] + "mod resolve": relatedCommands: [ + "cue help registryconfig", + ] + "mod tidy": relatedCommands: [ + "cue help environment", + ] + modules: relatedCommands: [ + "cue help mod", + "cue help registryconfig", + ] +} + // All commands cue: { cue: _ diff --git a/content/docs/reference/command/cue-help-mod-get/en.md b/content/docs/reference/command/cue-help-mod-get/en.md index 2021d0990a..df24608e31 100644 --- a/content/docs/reference/command/cue-help-mod-get/en.md +++ b/content/docs/reference/command/cue-help-mod-get/en.md @@ -11,3 +11,6 @@ tags: {{{with script "en" "cue cli help text"}}} cue help mod get {{{end}}} +## Related content + +- {{< linkto/related/reference "command/cue-help-environment" >}} \ No newline at end of file diff --git a/content/docs/reference/command/cue-help-mod-publish/en.md b/content/docs/reference/command/cue-help-mod-publish/en.md index 7ad47973ff..133172b22a 100644 --- a/content/docs/reference/command/cue-help-mod-publish/en.md +++ b/content/docs/reference/command/cue-help-mod-publish/en.md @@ -11,3 +11,6 @@ tags: {{{with script "en" "cue cli help text"}}} cue help mod publish {{{end}}} +## Related content + +- {{< linkto/related/reference "command/cue-help-environment" >}} \ No newline at end of file diff --git a/content/docs/reference/command/cue-help-mod-resolve/en.md b/content/docs/reference/command/cue-help-mod-resolve/en.md index 6f6280a4dd..ffc6788095 100644 --- a/content/docs/reference/command/cue-help-mod-resolve/en.md +++ b/content/docs/reference/command/cue-help-mod-resolve/en.md @@ -11,3 +11,6 @@ tags: {{{with script "en" "cue cli help text"}}} cue help mod resolve {{{end}}} +## Related content + +- {{< linkto/related/reference "command/cue-help-registryconfig" >}} \ No newline at end of file diff --git a/content/docs/reference/command/cue-help-mod-tidy/en.md b/content/docs/reference/command/cue-help-mod-tidy/en.md index eec4803683..7d46e5931d 100644 --- a/content/docs/reference/command/cue-help-mod-tidy/en.md +++ b/content/docs/reference/command/cue-help-mod-tidy/en.md @@ -11,3 +11,6 @@ tags: {{{with script "en" "cue cli help text"}}} cue help mod tidy {{{end}}} +## Related content + +- {{< linkto/related/reference "command/cue-help-environment" >}} \ No newline at end of file diff --git a/content/docs/reference/command/cue-help-mod/en.md b/content/docs/reference/command/cue-help-mod/en.md index af2d3ce1d9..55e45f24df 100644 --- a/content/docs/reference/command/cue-help-mod/en.md +++ b/content/docs/reference/command/cue-help-mod/en.md @@ -11,3 +11,13 @@ tags: {{{with script "en" "cue cli help text"}}} cue help mod {{{end}}} +## Related content + +- {{< linkto/related/reference "command/cue-help-modules" >}} +- {{< linkto/related/reference "command/cue-help-mod-edit" >}} +- {{< linkto/related/reference "command/cue-help-mod-fix" >}} +- {{< linkto/related/reference "command/cue-help-mod-get" >}} +- {{< linkto/related/reference "command/cue-help-mod-init" >}} +- {{< linkto/related/reference "command/cue-help-mod-publish" >}} +- {{< linkto/related/reference "command/cue-help-mod-resolve" >}} +- {{< linkto/related/reference "command/cue-help-mod-tidy" >}} \ No newline at end of file diff --git a/content/docs/reference/command/cue-help-modules/en.md b/content/docs/reference/command/cue-help-modules/en.md index bc454cea18..613c2bf563 100644 --- a/content/docs/reference/command/cue-help-modules/en.md +++ b/content/docs/reference/command/cue-help-modules/en.md @@ -11,3 +11,7 @@ tags: {{{with script "en" "cue cli help text"}}} cue help modules {{{end}}} +## Related content + +- {{< linkto/related/reference "command/cue-help-mod" >}} +- {{< linkto/related/reference "command/cue-help-registryconfig" >}} \ No newline at end of file diff --git a/hugo/content/en/docs/reference/command/cue-help-mod-get/index.md b/hugo/content/en/docs/reference/command/cue-help-mod-get/index.md index d0e665d0ea..07fdce5548 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod-get/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod-get/index.md @@ -45,3 +45,6 @@ Global Flags: --trace trace computation -v, --verbose print information about progress ``` +## Related content + +- {{< linkto/related/reference "command/cue-help-environment" >}} \ No newline at end of file diff --git a/hugo/content/en/docs/reference/command/cue-help-mod-publish/index.md b/hugo/content/en/docs/reference/command/cue-help-mod-publish/index.md index 3eb83439b6..6c13e06131 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod-publish/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod-publish/index.md @@ -42,3 +42,6 @@ Global Flags: --trace trace computation -v, --verbose print information about progress ``` +## Related content + +- {{< linkto/related/reference "command/cue-help-environment" >}} \ No newline at end of file diff --git a/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md b/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md index 8d5ca8c7bc..847a93c1ca 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md @@ -39,3 +39,6 @@ Global Flags: --trace trace computation -v, --verbose print information about progress ``` +## Related content + +- {{< linkto/related/reference "command/cue-help-registryconfig" >}} \ No newline at end of file diff --git a/hugo/content/en/docs/reference/command/cue-help-mod-tidy/index.md b/hugo/content/en/docs/reference/command/cue-help-mod-tidy/index.md index 93e759fa38..7f6370a299 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod-tidy/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod-tidy/index.md @@ -38,3 +38,6 @@ Global Flags: --trace trace computation -v, --verbose print information about progress ``` +## Related content + +- {{< linkto/related/reference "command/cue-help-environment" >}} \ No newline at end of file diff --git a/hugo/content/en/docs/reference/command/cue-help-mod/index.md b/hugo/content/en/docs/reference/command/cue-help-mod/index.md index 4ba384431b..d00f6c1d0f 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod/index.md @@ -41,3 +41,13 @@ Global Flags: Use "cue mod [command] --help" for more information about a command. ``` +## Related content + +- {{< linkto/related/reference "command/cue-help-modules" >}} +- {{< linkto/related/reference "command/cue-help-mod-edit" >}} +- {{< linkto/related/reference "command/cue-help-mod-fix" >}} +- {{< linkto/related/reference "command/cue-help-mod-get" >}} +- {{< linkto/related/reference "command/cue-help-mod-init" >}} +- {{< linkto/related/reference "command/cue-help-mod-publish" >}} +- {{< linkto/related/reference "command/cue-help-mod-resolve" >}} +- {{< linkto/related/reference "command/cue-help-mod-tidy" >}} \ No newline at end of file diff --git a/hugo/content/en/docs/reference/command/cue-help-modules/index.md b/hugo/content/en/docs/reference/command/cue-help-modules/index.md index a3ff0cc6aa..2995aef939 100644 --- a/hugo/content/en/docs/reference/command/cue-help-modules/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-modules/index.md @@ -41,3 +41,7 @@ For information on how to specify the CUE registry: cue help registryconfig ``` +## Related content + +- {{< linkto/related/reference "command/cue-help-mod" >}} +- {{< linkto/related/reference "command/cue-help-registryconfig" >}} \ No newline at end of file diff --git a/site.cue b/site.cue index 4cfec59efc..1bfc917fc6 100644 --- a/site.cue +++ b/site.cue @@ -344,9 +344,20 @@ template: ci.#writefs & { {{{with script "en" "cue cli help text"}}} \#(cmd.execCmd) {{{end}}} - + \#( strings.Join([if len(cmd.relatedCommands) > 0 for e in [ + "## Related content", "", + for c in cmd.relatedCommands + let path = strings.Replace(c, " ", "-", -1) { + #"- {{< linkto/related/reference "command/\#(path)" >}}"# + }, + ] {e}, + ], "\n")) """# } } } } + +// for _, related in cmd.relatedCommands { +// "- {{< linkto/related/reference \"command/\" >}}" +// }