|
22 | 22 | {{/* bigName is the kind length limit to change CSS styles when it needs to be truncated */}} |
23 | 23 | {{ $bigName := partial "apiBuilder/checkBigName" $kind }} |
24 | 24 |
|
| 25 | + {{/* Iterate over each served version and create separate entries */}} |
| 26 | + {{ range $versionItem := $crdContent.spec.versions }} |
| 27 | + {{ if $versionItem.served }} |
| 28 | + {{ $schema := $versionItem.schema.openAPIV3Schema }} |
| 29 | + {{ $version := $versionItem.name }} |
| 30 | + {{ $deprecated := $versionItem.deprecated }} |
| 31 | + {{ $description := $schema.description }} |
25 | 32 |
|
26 | | - {{/* Find the active version. We prefer the "storage: true" value but use "served: true" as a backup */}} |
27 | | - {{ $versionAndSchema := partial "apiBuilder/getVersionAndSchema" $crdContent.spec }} |
28 | | - {{ $schema := $versionAndSchema.schema.openAPIV3Schema }} |
29 | | - {{ $version := $versionAndSchema.version }} |
30 | | - {{ $deprecated := $versionAndSchema.deprecated }} |
31 | | - {{ $description := $schema.description }} |
| 33 | + {{/* The div containing the entire CRD information including the Expand All/Collapse All row */}} |
| 34 | + <div class="crd-root-row crd-container row align-middle bigName-row" data-kind="{{ $kind }}" data-group="{{ $group }}-{{ $kind}}" data-version="{{ $version }}-{{ $kind }}"> |
32 | 35 |
|
33 | | - {{/* The div containing the entire CRD information including the Expand All/Collapse All row */}} |
34 | | - <div class="crd-root-row crd-container row align-middle bigName-row" data-kind="{{ $kind }}" data-group="{{ $group }}-{{ $kind}}" data-version="{{ $version }}-{{ $kind }}"> |
| 36 | + {{/* generate the GKV line to expand/collapse the CRD data */}} |
| 37 | + {{ partial "apiBuilder/printGKVExpander" (dict "group" $group "version" $version "kind" $kind "deprecated" $deprecated) }} |
35 | 38 |
|
36 | | - {{/* generate the GKV line to expand/collapse the CRD data */}} |
37 | | - {{ partial "apiBuilder/printGKVExpander" (dict "group" $group "version" $version "kind" $kind "deprecated" $deprecated) }} |
38 | 39 |
|
| 40 | + {{/* The container to show/hide with information related to the CRD */}} |
| 41 | + <div class="collapse crd-expand {{$kind}}" id="{{$kind}}-{{$version}}"> |
| 42 | + {{/* Generate the "Download YAML" link */}} |
| 43 | + {{ partial "apiBuilder/downloadLink" (dict "group" $group "version" $version "kind" $kind "downloadPath" $downloadPath) }} |
39 | 44 |
|
40 | | - {{/* The container to show/hide with information related to the CRD */}} |
41 | | - <div class="collapse crd-expand {{$kind}}" id="{{$kind}}"> |
42 | | - {{/* Generate the "Download YAML" link */}} |
43 | | - {{ partial "apiBuilder/downloadLink" (dict "group" $group "version" $version "kind" $kind "downloadPath" $downloadPath) }} |
| 45 | + {{/* bigName-reset prevents the description from expanding into the x-scroll */}} |
| 46 | + <div class="description bigName-reset"> |
| 47 | + {{ $description | markdownify}} |
| 48 | + <br /> |
| 49 | + </div> |
44 | 50 |
|
45 | | - {{/* bigName-reset prevents the description from expanding into the x-scroll */}} |
46 | | - <div class="description bigName-reset"> |
47 | | - {{ $description | markdownify}} |
48 | | - <br /> |
49 | | - </div> |
50 | | - |
51 | | - {{/* Loop over each key inside the schema */}} |
52 | | - {{ range $key, $contents := $schema.properties }} |
| 51 | + {{/* Loop over each key inside the schema */}} |
| 52 | + {{ range $key, $contents := $schema.properties }} |
53 | 53 |
|
54 | | - {{/* Skip irrelevant keys at the top level */}} |
55 | | - {{ if not (in (slice "apiVersion" "description" "kind" "metadata") $key) }} |
56 | | - {{ partial "apiBuilder/processSpec" (dict "key" $key "contents" $contents "page" . "kind" $kind) }} |
57 | | - {{ end }} |
| 54 | + {{/* Skip irrelevant keys at the top level */}} |
| 55 | + {{ if not (in (slice "apiVersion" "description" "kind" "metadata") $key) }} |
| 56 | + {{ partial "apiBuilder/processSpec" (dict "key" $key "contents" $contents "page" . "kind" $kind) }} |
| 57 | + {{ end }} |
58 | 58 |
|
59 | | - {{ end }} |
| 59 | + {{ end }} |
60 | 60 |
|
61 | | - {{/* Generate the "Return to top" link */}} |
62 | | - {{ partialCached "apiBuilder/backToTopButton" . }} |
| 61 | + {{/* Generate the "Return to top" link */}} |
| 62 | + {{ partialCached "apiBuilder/backToTopButton" . }} |
63 | 63 |
|
64 | | - </div> |
65 | | - </div> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + {{ end }} |
| 67 | + {{ end }} |
66 | 68 | {{ end}} |
67 | 69 | </div> |
68 | 70 |
|
|
0 commit comments