From 7e74bd8c2dab8d2a3f6f57993ddff31970c25f72 Mon Sep 17 00:00:00 2001 From: Ray Zhou Date: Mon, 15 Jul 2024 15:11:51 -0600 Subject: [PATCH] define version only once Signed-off-by: Ray Zhou --- content/en/docs/v3.3/_index.md | 1 + content/en/docs/v3.4/_index.md | 1 + content/zh/docs/v3.3/_index.md | 1 + content/zh/docs/v3.4/_index.md | 1 + layouts/partials/searchInput.html | 74 +++++++++++++++++++------------ 5 files changed, 49 insertions(+), 29 deletions(-) diff --git a/content/en/docs/v3.3/_index.md b/content/en/docs/v3.3/_index.md index ce32a04ed..ad0ecd5b0 100644 --- a/content/en/docs/v3.3/_index.md +++ b/content/en/docs/v3.3/_index.md @@ -10,6 +10,7 @@ section1: title: KubeSphere Documentation content: Learn how to build and manage cloud-native applications using KubeSphere Container Platform. Get documentation, example code, tutorials, and more. image: /images/docs/v3.x/banner.png + version: "v3.3" sectionLink: docs: diff --git a/content/en/docs/v3.4/_index.md b/content/en/docs/v3.4/_index.md index 34666bfcd..a2e38840a 100644 --- a/content/en/docs/v3.4/_index.md +++ b/content/en/docs/v3.4/_index.md @@ -10,6 +10,7 @@ section1: title: KubeSphere Documentation content: Learn how to build and manage cloud-native applications using KubeSphere Container Platform. Get documentation, example code, tutorials, and more. image: /images/docs/v3.x/banner.png + version: "v3.4" sectionLink: docs: diff --git a/content/zh/docs/v3.3/_index.md b/content/zh/docs/v3.3/_index.md index d01f25db4..de86e2bf5 100644 --- a/content/zh/docs/v3.3/_index.md +++ b/content/zh/docs/v3.3/_index.md @@ -10,6 +10,7 @@ section1: title: KubeSphere 文档 content: 了解如何通过 KubeSphere 容器平台构建并管理云原生应用程序。获取文档、示例代码与教程等信息。 image: /images/docs/v3.x/banner.png + version: "v3.3" sectionLink: docs: diff --git a/content/zh/docs/v3.4/_index.md b/content/zh/docs/v3.4/_index.md index 62e1384aa..f55904350 100644 --- a/content/zh/docs/v3.4/_index.md +++ b/content/zh/docs/v3.4/_index.md @@ -10,6 +10,7 @@ section1: title: KubeSphere 文档 content: 了解如何通过 KubeSphere 容器平台构建并管理云原生应用程序。获取文档、示例代码与教程等信息。 image: /images/docs/v3.x/banner.png + version: "v3.4" sectionLink: docs: diff --git a/layouts/partials/searchInput.html b/layouts/partials/searchInput.html index 878185927..2f5ab03ec 100644 --- a/layouts/partials/searchInput.html +++ b/layouts/partials/searchInput.html @@ -1,5 +1,5 @@
- + @@ -7,34 +7,50 @@
+{{ define "recursiveVersion" }}{{ if isset . "version" }}{{ .Version }}{{ else if .Params.section1.version }}{{ .Params.section1.version }}{{ else if .Parent }}{{ template "recursiveVersion" .Parent }}{{ else }}{{ end }}{{ end }} \ No newline at end of file