-
+
+
+
+
+
{{ i18n "Last updated" }}:
+
+
+
+
-
-
-
-
-
{{ i18n "share" }}
+
+
+
+
+
+
+ {{ i18n "share" }}
+
+
-
-
- {{ define "content" }}
- {{ if .context.IsSection }}
-
{{ .context.LinkTitle }}
- {{ else }}
-
{{ .context.LinkTitle }}
- {{ end }}
-
{{ .context.Description }}
- {{ $count := add .count 1 }}
- {{ if .context.IsSection }}
- {{ range (union (where .context.Pages ".context.Params._build.render" "!=" false) .context.Sections).ByWeight }}
+ {{ define "content" }}
+ {{ if .context.IsSection }}
+
{{ .context.LinkTitle }}
+ {{ else }}
+
{{ .context.LinkTitle }}
+ {{ end }}
+
{{ .context.Description }}
+ {{ $count := add .count 1 }}
+ {{ if .context.IsSection }}
+ {{ range (union (where .context.Pages ".context.Params._build.render" "!=" false)
+ .context.Sections).ByWeight }}
{{ template "content" (dict "context" . "count" $count) }}
- {{ end }}
- {{ else}}
- {{ end }}
- {{ end }}
-
-
-
-
{{ .Title }}
- {{ .Content }}
- {{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
- {{ template "content" (dict "context" . "count" 2) }}
- {{ end }}
+ {{ end }}
+ {{ else}}
+ {{ end }}
+ {{ end }}
+
+
+
+
{{ .Title }}
+ {{ .Content }}
+ {{ range (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
+ {{ template "content" (dict "context" . "count" 2) }}
+ {{ end }}
+
+
+
+
+ {{ if .IsPage }}
+
+ {{ partial "pagination" . }}
+
+
+ {{ end }}
+
+
{{ if .IsPage }}
-
-
- {{ with .Next }}
-
-
-
- {{ i18n "Previous" }}
- : {{.LinkTitle}}
-
-
- {{ end }}
- {{ with .Prev }}
-
-
- {{ i18n "Next" }}
- : {{.LinkTitle}}
-
-
-
- {{ end }}
+
+
+
+ {{ i18n "What’s on this Page" }}
+
+
+ {{ .TableOfContents }}
+
+
{{ end }}
-
- {{ if .IsPage }}
-
-
-
- {{ i18n "What’s on this Page" }}
-
-
- {{ .TableOfContents }}
-
-
-
- {{ end }}
-
-
- {{ $aside := resources.Get "js/aside.js" }}
- {{ $asideJS := $aside | resources.Fingerprint "sha512" }}
-
-
- {{ $tab := resources.Get "js/markdown-tab.js" }}
- {{ $tabJS := $tab | resources.Fingerprint "sha512" }}
-
-
-
+
+ {{ $tab := resources.Get "js/markdown-tab.js" }}
+ {{ $tabJS := $tab | resources.Fingerprint "sha512" }}
+
+
+
-
+ var renderLatestTime = function (time) {
+ $('.update-time').html(time)
+ }
-
-
-
-
- {{ "/static/images/footer/wechat.svg" | readFile | safeHTML }}
-
-
Follow the official account
-
-
-
-
-
-
-
-
-
-
+ var bindClickMenu = function () {
+ var sectionMenu = $(".section-menu")
+ $('.section-control').on('mouseenter', function (e) {
+ if (sectionMenu.is(":hidden")) {
+ sectionMenu.show();
+ }
+ })
+
+ sectionMenu.on('mouseleave', function () {
+ sectionMenu.hide();
+ })
+
+ $(document).on("click", function () {
+ sectionMenu.hide()
+ });
+
+ sectionMenu.on("click", function (e) {
+ e.stopPropagation();
+ })
+ }
+
+ var bindClickSecondMenu = function () {
+ var sectionMenu = $(".section-2 .left-div")
+ $('.second-section-menu').on('click', function (e) {
+ sectionMenu.css("left", "0")
+
+ $(document).one("click", function () {
+ sectionMenu.css("left", "-274px")
+ });
+
+ e.stopPropagation()
+ })
+
+ sectionMenu.on("click", function (e) {
+ e.stopPropagation();
+ })
+ }
+
+ var useViewer = function () {
+ var viewer = new Viewer(document.querySelector('.md-body'), {
+ url: 'src'
+ })
+ }
+
+ var __main = function () {
+ getFileContributors()
+ bindClickMenu()
+ bindClickSecondMenu()
+ useViewer()
+ }
+
+ __main()
+
+
+
+
+
-
+
+
\ No newline at end of file
diff --git a/layouts/docs/single.html b/layouts/docs/single.html
index 4638628bf..1373408d5 100644
--- a/layouts/docs/single.html
+++ b/layouts/docs/single.html
@@ -41,10 +41,14 @@
+ {{ $version := index (strings.FindRE `v[0-9]+\.[0-9]+` .Page.RelPermalink) 0}}
+
+
@@ -54,6 +58,7 @@
+
+
+
+ {{ if .IsPage }}
+
+ {{ partial "pagination" . }}
+
{{ end }}
+
{{ if .IsPage }}
@@ -334,7 +326,7 @@
__main()
- $(".asciicast").children().attr( "title", "video" );
+ $(".asciicast").children().attr("title", "video");
@@ -349,16 +341,20 @@
-
+
-
-
-
+
+
+
{{ i18n "KubeSphere®️ 2023 All Rights Reserved." }}
diff --git a/layouts/partials/findFirstInSection.html b/layouts/partials/findFirstInSection.html
new file mode 100644
index 000000000..26834e793
--- /dev/null
+++ b/layouts/partials/findFirstInSection.html
@@ -0,0 +1,9 @@
+{{ if ne .Parent.CurrentSection .Parent.FirstSection }}
+{{ with .}}
+
+ {{ i18n "Next" }}
+ : {{.LinkTitle}}
+
+
+{{ end }}
+{{ end }}
\ No newline at end of file
diff --git a/layouts/partials/findLastInSection.html b/layouts/partials/findLastInSection.html
new file mode 100644
index 000000000..65bad7447
--- /dev/null
+++ b/layouts/partials/findLastInSection.html
@@ -0,0 +1,23 @@
+
+{{ if ne .Parent.CurrentSection .Parent.FirstSection }}
+
+{{ if .IsSection}}
+{{ $curSection := .Pages.ByWeight }}
+{{ $l := len $curSection}}
+{{ $page := index $curSection (sub $l 1)}}
+{{ partial "findLastInSection" $page}}
+
+{{ else }}
+
+
+
+
+
+ {{ i18n "Previous" }}
+ : {{.LinkTitle}}
+
+{{ end }}
+
+{{ end }}
\ No newline at end of file
diff --git a/layouts/partials/page_navigate.html b/layouts/partials/page_navigate.html
new file mode 100644
index 000000000..e8da4271b
--- /dev/null
+++ b/layouts/partials/page_navigate.html
@@ -0,0 +1,195 @@
+
+{{ $current := .context }}
+
+
+
+{{ if $current.IsPage}}
+{{ $g_parent := $current.Parent.Parent }}
+
+
+
+
+{{ $p_section := $g_parent.Pages.ByWeight }}
+{{ $length := len $p_section }}
+
+
+{{ if .prev }}
+{{ $first := index $p_section 0}}
+
+
+
+
+{{ if $current.InSection $first.CurrentSection }}
+
+
+
+
+{{ partial "page_navigate" (dict "context" $g_parent "prev" true)}}
+
+
+{{else}}
+
+
+
+{{ $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 "findLastInSection" $prevPage}}
+
+{{ end }}
+
+
+
+{{ else }}
+
+{{ $last := index $p_section (sub $length 1)}}
+
+
+
+{{ if $current.InSection $last.CurrentSection }}
+
+
+
+{{ partial "page_navigate" (dict "context" $g_parent "prev" false)}}
+
+
+{{ 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 "findFirstInSection" $nextPage}}
+
+{{ end }}
+
+{{ end }}
+
+
+
+
+{{ else }}
+{{ $g_parent := $current.Parent}}
+
+{{ $p_section := $g_parent.Pages.ByWeight }}
+{{ $length := len $p_section }}
+
+
+{{ if .prev}}
+{{ $first := index $p_section 0}}
+
+
+
+{{ if $current.InSection $first.CurrentSection }}
+
+{{ partial "page_navigate" (dict "context" $g_parent "prev" true)}}
+
+
+{{ else }}
+{{ $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 "findLastInSection" $prevPage}}
+
+{{ end }}
+
+
+
+{{ else }}
+
+{{ $last := index $p_section (sub $length 1)}}
+
+
+
+{{ if $current.InSection $last.CurrentSection }}
+
+
+{{ partial "page_navigate" (dict "context" $g_parent "prev" false)}}
+
+
+{{ 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 "findFirstInSection" $nextPage}}
+
+{{ end }}
+
+{{ end }}
+
+{{ end }}
\ No newline at end of file
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
new file mode 100644
index 000000000..7c5c616b8
--- /dev/null
+++ b/layouts/partials/pagination.html
@@ -0,0 +1,45 @@
+
+
+
+
+ {{ $current := .}}
+ {{ $p := .Parent.Pages.ByWeight }}
+ {{ $length := len $p }}
+
+
+
+ {{ $curIndex := 0 }}
+ {{ range $i, $p_sec := $p}}
+
+
+
+ {{ if eq $p_sec $current}}
+ {{ $curIndex = $i }}
+ {{ end }}
+ {{ end }}
+
+
+
+
+ {{ if gt $curIndex 0}}
+ {{ $prevPage := index $p (sub $curIndex 1) }}
+ {{ partial "findLastInSection" $prevPage}}
+ {{ else }}
+ {{ partial "page_navigate" (dict "context" . "prev" true)}}
+ {{ end }}
+
+
+
+ {{ if lt $curIndex (sub $length 1) }}
+ {{ $nextPage := index $p (add $curIndex 1)}}
+ {{ partial "findFirstInSection" $nextPage}}
+ {{ else }}
+ {{ partial "page_navigate" (dict "context" . "prev" false)}}
+ {{ end }}
+
+
\ No newline at end of file
diff --git a/layouts/partials/section.html b/layouts/partials/section.html
index e8a5cb865..7f79c5d10 100644
--- a/layouts/partials/section.html
+++ b/layouts/partials/section.html
@@ -1,41 +1,23 @@
-{{ $sections := .Sections.ByWeight }}
- {{ range $sections }}
-
-
-
- {{ .LinkTitle }}
-
- {{ $page_list := (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
- {{ $length := len $page_list}}
-
+ {{ if .ver }}
+ {{ $sections := where .context.Sections ".Params.section1.version" "==" .ver }}
- {{ if gt $length 6 }}
- {{ range first 5 $page_list }}
-
- {{ if .IsPage }}
- {{ .LinkTitle }}
- {{ else }}
- {{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
- {{ end }}
-
- {{ end }}
- {{ i18n "Learn More" }}...
- {{ else }}
- {{ range first 6 $page_list }}
-
- {{ if .IsPage }}
- {{ .LinkTitle }}
- {{ else }}
- {{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
- {{ end }}
-
- {{ end }}
- {{ end }}
-
-
+ {{ range $sections }}
+ {{ partial "section_item" . }}
{{ end }}
{{ range $sections }}
{{ end }}
+
+
+ {{ else }}
+ {{ $sections := .context.Sections.ByWeight }}
+
+ {{ range $sections }}
+ {{ partial "section_item" . }}
+ {{ end }}
+ {{ range $sections }}
+
+ {{ end }}
+ {{ end }}
\ No newline at end of file
diff --git a/layouts/partials/section_item.html b/layouts/partials/section_item.html
new file mode 100644
index 000000000..9296fa421
--- /dev/null
+++ b/layouts/partials/section_item.html
@@ -0,0 +1,33 @@
+
+
+
+ {{ .LinkTitle }}
+
+ {{ $page_list := (union (where .Pages ".Params._build.render" "!=" false) .Sections).ByWeight }}
+ {{ $length := len $page_list}}
+
+
+ {{ if gt $length 6 }}
+ {{ range first 5 $page_list }}
+
+ {{ if .IsPage }}
+ {{ .LinkTitle }}
+ {{ else }}
+ {{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
+ {{ end }}
+
+ {{ end }}
+ {{ i18n "Learn More" }}...
+ {{ else }}
+ {{ range first 6 $page_list }}
+
+ {{ if .IsPage }}
+ {{ .LinkTitle }}
+ {{ else }}
+ {{ partial "firstPageInSection" (dict "section" . "firstSection" .) }}
+ {{ end }}
+
+ {{ end }}
+ {{ end }}
+
+
\ No newline at end of file
diff --git a/layouts/partials/tree.html b/layouts/partials/tree.html
index f0084095b..3d1655d44 100644
--- a/layouts/partials/tree.html
+++ b/layouts/partials/tree.html
@@ -1,22 +1,29 @@
+
+
+
+
-
+
+
{{ define "section-tree-nav-section" }}
{{ $s := .section }}
{{ $p := .page }}
{{ $list_active := $p.IsDescendant $s }}
-{{ if eq $s.Parent $s.FirstSection }}
+
+{{ if eq $s.Parent $s.FirstSection }}
{{ else }}
@@ -25,7 +32,21 @@
{{ end }}
+
{{ $pages := (union (where $s.Pages ".Params._build.render" "!=" false) $s.Sections).ByWeight }}
+
+
+
+
+
{{ range $pages }}
{{ $active := eq . $p }}
@@ -39,8 +60,8 @@
{{ end }}
+
\ No newline at end of file