From b0469e6de0f28366f8f6f6bab2ed4136860eb4cd Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Fri, 28 Aug 2020 13:47:18 +0100 Subject: [PATCH] Revise list of available documentation versions For older releases, the previous rendering wasn't quite right. Implement a custom layout for the supported versions list This commit does NOT remove the shortcode named {{< versions-other >}} because it is still used in some localizations. --- .../en/docs/home/supported-doc-versions.md | 26 ++----------- i18n/en.toml | 9 +++++ layouts/docs/supported-versions.html | 39 +++++++++++++++++++ 3 files changed, 52 insertions(+), 22 deletions(-) create mode 100644 layouts/docs/supported-versions.html diff --git a/content/en/docs/home/supported-doc-versions.md b/content/en/docs/home/supported-doc-versions.md index bd368b2b54..b955f95f56 100644 --- a/content/en/docs/home/supported-doc-versions.md +++ b/content/en/docs/home/supported-doc-versions.md @@ -1,30 +1,12 @@ --- -title: Supported Versions of the Kubernetes Documentation -content_type: concept +title: Available Documentation Versions +content_type: custom +layout: supported-versions card: name: about weight: 10 - title: Supported Versions of the Documentation + title: Available Documentation Versions --- - - This website contains documentation for the current version of Kubernetes and the four previous versions of Kubernetes. - - - - - -## Current version - -The current version is -[{{< param "version" >}}](/). - -## Previous versions - -{{< versions-other >}} - - - - diff --git a/i18n/en.toml b/i18n/en.toml index c59107c7c8..69b6c645e6 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -54,6 +54,15 @@ other = "I AM..." [docs_label_users] other = "Users" +[docs_version_current] +other = "(this documentation)" + +[docs_version_latest_heading] +other = "Latest version" + +[docs_version_other_heading] +other = "Older versions" + [examples_heading] other = "Examples" diff --git a/layouts/docs/supported-versions.html b/layouts/docs/supported-versions.html new file mode 100644 index 0000000000..a1c2702741 --- /dev/null +++ b/layouts/docs/supported-versions.html @@ -0,0 +1,39 @@ +{{ define "main" }} +
+ {{ partial "docs/content-page" (dict "ctx" . "page" .) }} + {{ $versions := .Page.Param "versions" }} + {{ $thisPageRelUri := .Page.RelPermalink }} + {{ $thisVersionArray := split (.Page.Param "version") "." }} + {{ $.Scratch.Set "version-class" (slice "placeholder") }} + {{/* "placeholder" is also used later to check whether we opened the