Ordering content by weight (#8787)

* ordering content by weight

* fix weight of 'setup' contents

* fix weight of 'concepts' contents

* fix weight of 'tasks' contents

* fix weight of 'tutorials' contents

* fix weight of 'reference' contents

* Revert "fix weight of 'tasks' contents"

This reverts commit 4b6916bed07c92c5f9eed75fb0a7ef0244266623.

* Revert "fix weight of 'tutorials' contents"

This reverts commit a1f783314337b1eb40017aef47a6bf1453d8c840.

* Revert "fix weight of 'setup' contents"

This reverts commit 91c8de366587eed25c803f8e7d5a59005adb6025.

* Revert "fix weight of 'reference' contents"

This reverts commit cc95605f6a9863f8a4ffb636178c69a80d302c3e.
This commit is contained in:
Takuya Tokuda
2018-06-07 08:51:26 +09:00
committed by k8s-ci-robot
parent 874ebb8f0a
commit 0502832cbb
64 changed files with 78 additions and 9 deletions
+11 -9
View File
@@ -1,25 +1,27 @@
{{ $section := . }}
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
{{ template "section-tree-nav-pages" . }}
{{ template "section-tree-nav" $section }}
{{ template "section-tree-nav" . }}
{{ define "section-tree-nav" }}
{{ $sections := where .Sections ".Params.toc_hide" "!=" true }}
{{ $sections := where (union .Pages .Sections).ByWeight ".Params.toc_hide" "!=" true }}
{{ range $sections }}
{{ if .IsPage }}
{{ template "section-tree-nav-page" . }}
{{ else }}
{{ template "section-tree-nav-section" . }}
{{ end }}
{{ end }}
{{ end }}
{{ define "section-tree-nav-section" }}
<div class="item" data-title="{{ .LinkTitle }}">
<div class="container">
{{ if ge (len .Content) 10 }}
{{/* The section page has content, so link to it. */}}
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
{{ end }}
{{ template "section-tree-nav-pages" . }}
{{ template "section-tree-nav" . }}
</div>
</div>
{{ end }}
{{ end }}
{{ define "section-tree-nav-pages" }}
{{ range where .Pages ".Params.toc_hide" "!=" true }}
{{ define "section-tree-nav-page" }}
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
{{ end }}
{{ end }}