-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3204 from ROOMrepair/bugfix/issue_3167
fix: try to fix KubeSphere 4.1 docs display bugs
- Loading branch information
Showing
13 changed files
with
259 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ if ne .Parent.CurrentSection .Parent.FirstSection }} <!-- out of boundary --> | ||
{{ with .}} | ||
<a class="next" href="{{.RelPermalink}}"> | ||
{{ i18n "Next" }} | ||
<span>: {{.LinkTitle}}</span> | ||
<img src="/images/docs/v3.3/next.svg" alt="{{ i18n " Next" }}"> | ||
</a> | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- find last page in section --> | ||
{{ if ne .Parent.CurrentSection .Parent.FirstSection }} <!-- out of boundary --> | ||
|
||
{{ if .IsSection}} <!-- recursive --> | ||
{{ $curSection := .Pages.ByWeight }} | ||
{{ $l := len $curSection}} | ||
{{ $page := index $curSection (sub $l 1)}} | ||
{{ partial "findLastInPreSection" $page}} | ||
{{ else }} <!-- not recursive --> | ||
|
||
<a class="last" href="{{.RelPermalink}}"> | ||
<img src="/images/docs/v3.3/last.svg" alt="{{ i18n " Previous" }}"> | ||
{{ i18n "Previous" }} | ||
<span>: {{.LinkTitle}}</span> | ||
</a> | ||
{{ end }} | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{{ $current := .context }} | ||
|
||
<!-- choose different bottom up step --> | ||
<!-- in this case page.parent is index --> | ||
{{ $g_parent := "" }} | ||
{{ if $current.IsPage }} | ||
{{ $g_parent = $current.Parent.Parent }} | ||
{{ else }} | ||
{{ $g_parent = $current.Parent}} | ||
{{ end }} | ||
|
||
<!-- SECTION1 --> | ||
<!-- important! here we need call .Pages to include both pure page and _index --> | ||
{{ $p_section := $g_parent.Pages.ByWeight }} | ||
{{ $length := len $p_section }} | ||
<!-- page prev --> | ||
{{ if .prev }} | ||
{{ $first := index $p_section 0}} | ||
|
||
<!-- check if is already the first section --> | ||
<!-- if is first section,we need to bottom up --> | ||
{{ if $current.InSection $first.CurrentSection }} | ||
<!-- bottom up --> | ||
{{ partial "page_navigation" (dict "context" $g_parent "prev" true)}} | ||
|
||
<!--if not the first section just go to pre section last page (last page of pre section of p_section)--> | ||
{{else}} | ||
|
||
<!-- find current page's section position --> | ||
{{ $curIndex := 0 }} | ||
{{ range $i, $p_sec := $p_section}} | ||
{{ if eq $p_sec $current.CurrentSection}} | ||
{{ $curIndex = $i }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ $prevPage := index $p_section (sub $curIndex 1) }} | ||
{{ partial "findLastInPreSection" $prevPage}} | ||
|
||
{{ end }} <!-- close of check page prev bottom up --> | ||
<!-- SECTION1 --> | ||
|
||
<!-- page next --> | ||
{{ else }} | ||
|
||
<!-- SECTION2 --> | ||
{{ $last := index $p_section (sub $length 1)}} | ||
|
||
<!-- if is last section,we need to bottom up --> | ||
{{ if $current.InSection $last.CurrentSection }} | ||
|
||
<!-- bottom up --> | ||
{{ partial "page_navigation" (dict "context" $g_parent "prev" false)}} | ||
|
||
<!--if not the last section just go to next section --> | ||
{{ else }} | ||
|
||
{{ $curIndex := 0 }} | ||
{{ range $i, $p_sec := $p_section}} | ||
{{ if eq $p_sec $current.CurrentSection}} | ||
{{ $curIndex = $i }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ $nextPage := index $p_section (add $curIndex 1) }} | ||
{{ partial "findFirstInNextSection" $nextPage}} | ||
|
||
{{ end }} <!-- close of check next bottom up --> | ||
<!-- SECTION2 --> | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<div class="page-div common-flex-layout"> | ||
{{ if .IsPage }} | ||
<!-- if not each page in a section is pure page we can't simply use prev/nextInsection --> | ||
<!-- todo!!! is there a better way to solve this ? --> | ||
{{ $current := .}} | ||
{{ $p := .Parent.Pages.ByWeight }} | ||
{{ $length := len $p }} | ||
|
||
<!-- find current page's section position --> | ||
{{ $curIndex := 0 }} | ||
{{ range $i, $p_sec := $p}} | ||
|
||
{{ if eq $p_sec $current}} | ||
{{ $curIndex = $i }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
<!-- prev --> | ||
{{ if gt $curIndex 0}} | ||
{{ $prevPage := index $p (sub $curIndex 1) }} | ||
{{ partial "findLastInPreSection" $prevPage}} | ||
{{ else }} | ||
{{ partial "page_navigation" (dict "context" . "prev" true)}} | ||
{{ end }} | ||
|
||
<!-- next --> | ||
{{ if lt $curIndex (sub $length 1) }} | ||
{{ $nextPage := index $p (add $curIndex 1)}} | ||
{{ partial "findFirstInNextSection" $nextPage}} | ||
{{ else }} | ||
{{ partial "page_navigation" (dict "context" . "prev" false)}} | ||
{{ end }} | ||
{{ else }} | ||
<!-- index prev --> | ||
{{ partial "page_navigation" (dict "context" . "prev" true)}} | ||
|
||
<!-- index next --> | ||
{{ $pages:= .Pages.ByWeight}} | ||
{{ if gt $pages 0}} | ||
{{ with (index $pages 0)}} | ||
<a class="next" href="{{.RelPermalink}}"> | ||
{{ i18n "Next" }} | ||
<span>: {{.LinkTitle}}</span> | ||
<img src="/images/docs/v3.3/next.svg" alt="{{ i18n " Next" }}"> | ||
</a> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
</div> |
Oops, something went wrong.