mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
fix: try to remove contents that do not match version in hover menu
Signed-off-by: ROOMrepair <twekjz@gmail.com>
This commit is contained in:
parent
53b9c9a711
commit
d15383ba89
|
|
@ -8,6 +8,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/common/banner.png
|
||||
version: v4.1
|
||||
|
||||
sectionLink:
|
||||
docs:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ section1:
|
|||
title: KubeSphere
|
||||
content: 了解如何通过 KubeSphere 构建并管理云原生应用程序。获取文档、示例代码与教程等信息。
|
||||
image: /images/docs/common/banner.png
|
||||
version: v4.1
|
||||
|
||||
sectionLink:
|
||||
docs:
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
<section class="section-2">
|
||||
<div class="common-layout">
|
||||
{{ partial "section" . }}
|
||||
{{ partial "section" (dict "context" .) }}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
|
|
|||
|
|
@ -40,10 +40,13 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|||
</div>
|
||||
</section>
|
||||
|
||||
{{ $version := index (strings.FindRE `v[0-9]+\.[0-9]+` .Page.RelPermalink) 0}}
|
||||
<!-- {{ $doc_version := printf "/docs/%s" $version }} -->
|
||||
|
||||
<section class="section-menu">
|
||||
{{ with (.GetPage "/docs") }}
|
||||
<div class="common-layout">
|
||||
{{ partial "section" . }}
|
||||
{{ partial "section" (dict "context" . "ver" $version) }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -41,10 +41,13 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
{{ $version := index (strings.FindRE `v[0-9]+\.[0-9]+` .Page.RelPermalink) 0}}
|
||||
<!-- {{ $doc_version := printf "/docs/%s" $version }} -->
|
||||
|
||||
<section class="section-menu">
|
||||
{{ with (.GetPage "/docs") }}
|
||||
<div class="common-layout">
|
||||
{{ partial "section" . }}
|
||||
{{ partial "section" (dict "context" . "ver" $version) }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,41 +1,22 @@
|
|||
{{ $sections := .Sections.ByWeight }}
|
||||
<ul class="common-flex-layout">
|
||||
{{ range $sections }}
|
||||
<li>
|
||||
<p>
|
||||
<span><img src="{{ .Params.icon }}" alt="{{ .LinkTitle }}"></span>
|
||||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||||
</p>
|
||||
{{ $page_list := (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
|
||||
{{ $length := len $page_list}}
|
||||
<ul>
|
||||
{{ if .ver }}
|
||||
{{ $sections := where .context.Sections ".Params.section1.version" "==" .ver }}
|
||||
|
||||
{{ if gt $length 6 }}
|
||||
{{ range first 5 $page_list }}
|
||||
<li>
|
||||
{{ if .IsPage }}
|
||||
<a href="{{ .RelPermalink }}" title="{{ .LinkTitle }}">{{ .LinkTitle }}</a>
|
||||
{{ else }}
|
||||
{{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ i18n "Learn More" }}...</a></li>
|
||||
{{ else }}
|
||||
{{ range first 6 $page_list }}
|
||||
<li>
|
||||
{{ if .IsPage }}
|
||||
<a href="{{ .RelPermalink }}" title="{{ .LinkTitle }}">{{ .LinkTitle }}</a>
|
||||
{{ else }}
|
||||
{{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ range $sections }}
|
||||
{{ partial "section_item" . }}
|
||||
{{ end }}
|
||||
{{ range $sections }}
|
||||
<li style="height: 0; margin: 0; padding: 0;"></li>
|
||||
{{ end }}
|
||||
|
||||
<!-- render all -->
|
||||
{{ else }}
|
||||
{{ $sections := .context.Sections.ByWeight }}
|
||||
{{ range $sections }}
|
||||
{{ partial "section_item" . }}
|
||||
{{ end }}
|
||||
{{ range $sections }}
|
||||
<li style="height: 0; margin: 0; padding: 0;"></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<li>
|
||||
<p>
|
||||
<span><img src="{{ .Params.icon }}" alt="{{ .LinkTitle }}"></span>
|
||||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||||
</p>
|
||||
{{ $page_list := (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
|
||||
{{ $length := len $page_list}}
|
||||
<ul>
|
||||
{{ if gt $length 6 }}
|
||||
{{ range first 5 $page_list }}
|
||||
<li>
|
||||
{{ if .IsPage }}
|
||||
<a href="{{ .RelPermalink }}" title="{{ .LinkTitle }}">{{ .LinkTitle }}</a>
|
||||
{{ else }}
|
||||
{{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ i18n "Learn More" }}...</a></li>
|
||||
{{ else }}
|
||||
{{ range first 6 $page_list }}
|
||||
<li>
|
||||
{{ if .IsPage }}
|
||||
<a href="{{ .RelPermalink }}" title="{{ .LinkTitle }}">{{ .LinkTitle }}</a>
|
||||
{{ else }}
|
||||
{{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
Loading…
Reference in New Issue