{{ .Content }} - + {{ $paginator := .Scratch.Get "paginator" }} {{ range $paginator.Pages }}

{{.Title}}

- + {{ if .Params.Image }}
{{ .Params.Title }}
{{end}} - +

{{ .Summary | safeHTML }}

{{ if .Truncated }}
@@ -95,38 +94,38 @@
- + {{ with .Params.Author }}
person_outline By: {{ . }}
{{end}} - + {{ if eq .Section "events" }} {{ with .Params.EventDate }}
event {{ . }}
{{end}} - + {{ else }} - + {{ with .Params.Date }}
event {{ .Format "January 2, 2006" }}
{{end}} {{end}} - + {{ if eq .Section "blog" }}
timer Read Time: {{.ReadingTime}} minutes
{{end}} - + {{ with .Params.Location }}
location_on {{ . }}
{{end}} - +
{{ end }}
{{ template "_internal/pagination.html" . }} - +
{{ partial "page-edit.html" . }}
-
+
-{{ if .Title }} -{{.Title}} -{{ else }} -Quick Start Guide -{{end}} + {{ if .Title }} + {{.Title}} + {{ else }} + (No Title) + {{end}} @@ -60,36 +63,72 @@ Quick Start Guide
-
+
    - {{ template "section-tree-nav" ($.Scratch.Get "topLevel") }} - -
  • - - Back to the top - - - - - - - - -
  • + {{ $activeNode := . }} + {{ range ($.Scratch.Get "topLevel").Sections }} + {{ template "menu" dict "node" . "activeNode" $activeNode }} + {{ end }}
-{{ define "section-tree-nav" }} - {{ range .Sections}} -
  • {{ .Title }} - {{if gt (len .Sections) 0}} - - {{end}} -
  • +{{ define "menu" }} + {{/* .node and .activeNode come from the caller */}} + {{- $activeNode := .activeNode -}} + {{- with .node -}} + {{- $isActive := "" -}} + {{- if eq .UniqueID $activeNode.UniqueID -}} + {{- $isActive = "active" -}} + {{- end -}} + + {{- $isOpen := false -}} + {{- if (or .Params.alwaysOpen (.IsAncestor $activeNode)) -}} + {{- $isOpen = true -}} + {{- end -}} + + {{- if .IsSection -}} + {{- $children := (add (len .Pages) (len .Sections)) -}} +
  • + + {{- if .Params.shortTitle -}} + {{ .Params.shortTitle}} + {{- else -}} + {{ .Title }} + {{- end -}} + {{- if gt $children 0 -}} + + + + + + {{- end -}} + + {{if gt $children 0}} + + {{- end -}} +
  • + {{- else if not .Params.hidden -}} +
  • + + {{- if .Params.shortTitle -}} + {{ .Params.shortTitle}} + {{- else -}} + {{ .Title }} + {{- end -}} + +
  • + {{- end -}} {{ end }} {{ end }} diff --git a/layouts/partials/page-nav.html b/layouts/partials/page-nav.html index 566e9c70ba3..0891b848c42 100644 --- a/layouts/partials/page-nav.html +++ b/layouts/partials/page-nav.html @@ -7,7 +7,6 @@ {{ range .Sections}}
  • {{ .Title }} {{if gt (len .Sections) 0}} -
      {{ range .Pages }}
    • {{ .Title }}
    • diff --git a/package.json b/package.json index d00a476da44..d77551d3f4f 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "jsdom": "^11.11.0", "lory.js": "^2.4.1", "md5": "^2.2.1", - "ml-stack-nav": "^1.1.2", "moment": "^2.20.1", "rancher-website-theme": "https://github.com/rancherlabs/website-theme.git", "request": "^2.87.0",