File tree Expand file tree Collapse file tree 4 files changed +53
-22
lines changed Expand file tree Collapse file tree 4 files changed +53
-22
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- title : Supported Versions of the Kubernetes Documentation
3
- content_type : concept
2
+ title : Available Documentation Versions
3
+ content_type : custom
4
+ layout : supported-versions
4
5
card :
5
6
name : about
6
7
weight : 10
7
- title : Supported Versions of the Documentation
8
+ title : Available Documentation Versions
8
9
---
9
10
10
- <!-- overview -->
11
-
12
11
This website contains documentation for the current version of Kubernetes
13
12
and the four previous versions of Kubernetes.
14
-
15
-
16
-
17
- <!-- body -->
18
-
19
- ## Current version
20
-
21
- The current version is
22
- [ {{< param "version" >}}] ( / ) .
23
-
24
- ## Previous versions
25
-
26
- {{< versions-other >}}
27
-
28
-
29
-
30
-
Original file line number Diff line number Diff line change @@ -54,6 +54,15 @@ other = "I AM..."
54
54
[docs_label_users ]
55
55
other = " Users"
56
56
57
+ [docs_version_current ]
58
+ other = " (this documentation)"
59
+
60
+ [docs_version_latest_heading ]
61
+ other = " Latest version"
62
+
63
+ [docs_version_other_heading ]
64
+ other = " Older versions"
65
+
57
66
[examples_heading ]
58
67
other = " Examples"
59
68
Original file line number Diff line number Diff line change
1
+ {{ define "main" }}
2
+ < div class ="td-content ">
3
+ {{ partial "docs/content-page" (dict "ctx" . "page" .) }}
4
+ {{ $versions := .Page.Param "versions" }}
5
+ {{ $thisPageRelUri := .Page.RelPermalink }}
6
+ {{ $thisVersionArray := split (.Page.Param "version") "." }}
7
+ {{ $.Scratch.Set "version-class" (slice "placeholder") }}
8
+ {{/* "placeholder" is also used later to check whether we opened the < ul > */}}
9
+ {{ range $index, $version := $versions }}
10
+ {{ $.Scratch.Set "version-class" (slice "") }}
11
+ {{ $versionArray := split .version "." }}
12
+
13
+ {{ if eq $index 0 }}
14
+ < h2 id ="version-latest "> {{ T "docs_version_latest_heading" }}</ h2 >
15
+ < ul >
16
+ {{ $.Scratch.Set "version-class" ($.Scratch.Get "version-class" | append "version-latest" ) }}
17
+ {{ end }}
18
+ {{ if eq $index 1 }}
19
+ </ ul >
20
+ < h2 id ="versions-older "> {{ T "docs_version_other_heading" }}</ h2 >
21
+ < ul >
22
+ {{ end }}
23
+
24
+ {{ if eq .version ( delimit $thisVersionArray "." ) }}
25
+ {{ $.Scratch.Set "version-class" ($.Scratch.Get "version-class" | append "version-current" ) }}
26
+ {{ end }}
27
+
28
+ < li class ="{{ delimit ( $.Scratch.Get "version-class ") " " }}">
29
+ < a href ="{{ .url }}{{ $thisPageRelUri }} "> {{ .version }}</ a >
30
+ {{ if eq .version ( delimit $thisVersionArray "." ) }}
31
+ {{ T "docs_version_current" }}
32
+ {{ end }}
33
+ </ li >
34
+ {{ end }}
35
+ {{ if ne (index ($.Scratch.Get "version-class") 0) "placeholder" }}
36
+ </ ul >
37
+ {{ end }}
38
+
39
+ {{ end }}
Original file line number Diff line number Diff line change
1
+ {{/* this shortcode is DEPRECATED */}}
1
2
{{ $versions := .Page.Param "versions" }}
2
3
{{ $thisVersion := .Page.Param "version" }}
3
4
< ul >
You can’t perform that action at this time.
0 commit comments