diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b4cf988cb2f..d379e12456b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -4,7 +4,22 @@ {{ define "hero" }}
-

Rancher Docs

+
+ {{ range $product := $.Site.Sections }} + {{ range $version := .Sections }} + {{ range $language := .Sections }} + {{if $.CurrentSection}} + {{ if .IsAncestor $.CurrentSection }} + {{ .Params.shortTitle }} + {{end}} + {{end}} + {{end}} + {{end}} + {{end}} +
+ {{ with .Params.Title }} +

{{ . }}

+ {{end}} {{ with .Params.Author }} {{ . }} @@ -13,29 +28,18 @@ {{ end }} {{ define "main" }} -
- {{ partial "docs-nav.html" . }} - {{ $secondLevel := ($.Scratch.Get "secondLevel") }} - {{ $.Scratch.Set "showSidebar" false }} - {{ with $secondLevel }} - {{ if (gt (len .Sections) 0) }} - {{ $.Scratch.Set "showSidebar" true }} - {{end}} - {{end}} +
- {{ if ($.Scratch.Get "showSidebar") }} - - {{end}} -
+ + +
- {{ with .Params.Title }} -

{{ . }}

- {{end}} + {{ .Content }} {{ range (.Paginator 5).Pages }} @@ -92,13 +96,13 @@
{{ partial "page-edit.html" . }}
- {{ with .TableOfContents }} +
{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 049c70bc34b..f5231f970ab 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,7 +4,10 @@ {{ define "hero" }}
-

Rancher Docs

+
Rancher 2.0 Docs
+ {{ with .Params.Title }} +

{{ . }}

+ {{end}} {{ with .Params.Author }} @@ -13,40 +16,29 @@ {{ end }} {{ define "main" }} -
- {{ partial "docs-nav.html" . }} - {{ $secondLevel := ($.Scratch.Get "secondLevel") }} - {{ $.Scratch.Set "showSidebar" false }} - {{ with $secondLevel }} - {{ if (gt (len .Sections) 0) }} - {{ $.Scratch.Set "showSidebar" true }} - {{end}} - {{end}} +
- {{ if ($.Scratch.Get "showSidebar") }} - - {{end}} -
+ + +
- {{ with .Params.Title }} -

{{ . }}

- {{end}} + {{ .Content }}
{{ partial "page-edit.html" . }}
- -
diff --git a/layouts/partials/docs-side-nav.html b/layouts/partials/docs-side-nav.html index b87ef0c1100..f506673c6d2 100644 --- a/layouts/partials/docs-side-nav.html +++ b/layouts/partials/docs-side-nav.html @@ -1,13 +1,63 @@ +{{ $.Scratch.Set "topLevel" . }} +{{ range $product := $.Site.Sections }} + {{ range $version := .Sections }} + {{ range $language := .Sections }} + {{if $.CurrentSection}} + {{ if .IsAncestor $.CurrentSection }} + {{ $.Scratch.Set "topLevel" . }} + {{end}} + {{end}} + {{end}} + {{end}} +{{end}} + + + + {{ define "section-tree-nav" }} {{ range .Sections}}
  • {{ .Title }} {{if gt (len .Sections) 0}} - add_box + add_box