diff --git a/themes/geekboot/layouts/partials/apiBuilder/getVersionAndSchema.html b/themes/geekboot/layouts/partials/apiBuilder/getVersionAndSchema.html index d84dc6e85..502c592e6 100644 --- a/themes/geekboot/layouts/partials/apiBuilder/getVersionAndSchema.html +++ b/themes/geekboot/layouts/partials/apiBuilder/getVersionAndSchema.html @@ -4,11 +4,19 @@ {{ $deprecated := false }} {{ range .versions }} - {{ if index . "storage" }} + {{ if and (index . "storage") (not .deprecated) }} {{ $version = .name }} {{ $schema = .schema }} {{ $deprecated = .deprecated }} - {{ else if (and (index . "served") (not $version)) }} + {{ else if and (index . "served") (not .deprecated) (not $version) }} + {{ $version = .name }} + {{ $schema = .schema }} + {{ $deprecated = .deprecated }} + {{ else if and (index . "storage") (not $version) }} + {{ $version = .name }} + {{ $schema = .schema }} + {{ $deprecated = .deprecated }} + {{ else if and (index . "served") (not $version) }} {{ $version = .name }} {{ $schema = .schema }} {{ $deprecated = .deprecated }} diff --git a/themes/geekboot/layouts/partials/apiBuilder/printGKVExpander.html b/themes/geekboot/layouts/partials/apiBuilder/printGKVExpander.html index 7e3c58332..f53d30631 100644 --- a/themes/geekboot/layouts/partials/apiBuilder/printGKVExpander.html +++ b/themes/geekboot/layouts/partials/apiBuilder/printGKVExpander.html @@ -8,11 +8,11 @@ {{/* Collapse/Expand Button and Kind name */}}
{{/* Plus/Minus Button */}} - + {{/* CRD name text */}} -
diff --git a/themes/geekboot/layouts/partials/crds.html b/themes/geekboot/layouts/partials/crds.html index ac06aca87..2baf7002e 100644 --- a/themes/geekboot/layouts/partials/crds.html +++ b/themes/geekboot/layouts/partials/crds.html @@ -22,47 +22,49 @@ {{/* bigName is the kind length limit to change CSS styles when it needs to be truncated */}} {{ $bigName := partial "apiBuilder/checkBigName" $kind }} + {{/* Iterate over each served version and create separate entries */}} + {{ range $versionItem := $crdContent.spec.versions }} + {{ if $versionItem.served }} + {{ $schema := $versionItem.schema.openAPIV3Schema }} + {{ $version := $versionItem.name }} + {{ $deprecated := $versionItem.deprecated }} + {{ $description := $schema.description }} - {{/* Find the active version. We prefer the "storage: true" value but use "served: true" as a backup */}} - {{ $versionAndSchema := partial "apiBuilder/getVersionAndSchema" $crdContent.spec }} - {{ $schema := $versionAndSchema.schema.openAPIV3Schema }} - {{ $version := $versionAndSchema.version }} - {{ $deprecated := $versionAndSchema.deprecated }} - {{ $description := $schema.description }} + {{/* The div containing the entire CRD information including the Expand All/Collapse All row */}} +
- {{/* The div containing the entire CRD information including the Expand All/Collapse All row */}} -
+ {{/* generate the GKV line to expand/collapse the CRD data */}} + {{ partial "apiBuilder/printGKVExpander" (dict "group" $group "version" $version "kind" $kind "deprecated" $deprecated) }} - {{/* generate the GKV line to expand/collapse the CRD data */}} - {{ partial "apiBuilder/printGKVExpander" (dict "group" $group "version" $version "kind" $kind "deprecated" $deprecated) }} + {{/* The container to show/hide with information related to the CRD */}} +
+ {{/* Generate the "Download YAML" link */}} + {{ partial "apiBuilder/downloadLink" (dict "group" $group "version" $version "kind" $kind "downloadPath" $downloadPath) }} - {{/* The container to show/hide with information related to the CRD */}} -
- {{/* Generate the "Download YAML" link */}} - {{ partial "apiBuilder/downloadLink" (dict "group" $group "version" $version "kind" $kind "downloadPath" $downloadPath) }} + {{/* bigName-reset prevents the description from expanding into the x-scroll */}} +
+ {{ $description | markdownify}} +
+
- {{/* bigName-reset prevents the description from expanding into the x-scroll */}} -
- {{ $description | markdownify}} -
-
- - {{/* Loop over each key inside the schema */}} - {{ range $key, $contents := $schema.properties }} + {{/* Loop over each key inside the schema */}} + {{ range $key, $contents := $schema.properties }} - {{/* Skip irrelevant keys at the top level */}} - {{ if not (in (slice "apiVersion" "description" "kind" "metadata") $key) }} - {{ partial "apiBuilder/processSpec" (dict "key" $key "contents" $contents "page" . "kind" $kind) }} - {{ end }} + {{/* Skip irrelevant keys at the top level */}} + {{ if not (in (slice "apiVersion" "description" "kind" "metadata") $key) }} + {{ partial "apiBuilder/processSpec" (dict "key" $key "contents" $contents "page" . "kind" $kind) }} + {{ end }} - {{ end }} + {{ end }} - {{/* Generate the "Return to top" link */}} - {{ partialCached "apiBuilder/backToTopButton" . }} + {{/* Generate the "Return to top" link */}} + {{ partialCached "apiBuilder/backToTopButton" . }} -
-
+
+
+ {{ end }} + {{ end }} {{ end}}