docs top nav

This commit is contained in:
lvuch
2018-05-25 11:50:05 -07:00
committed by Denise
parent c611c27958
commit 6c25241694
3 changed files with 24 additions and 19 deletions
+1 -1
View File
@@ -13,8 +13,8 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "docs-nav.html" . }}
<div class="wrapper"> <div class="wrapper">
{{ partial "docs-nav.html" . }}
{{ $secondLevel := ($.Scratch.Get "secondLevel") }} {{ $secondLevel := ($.Scratch.Get "secondLevel") }}
{{ $.Scratch.Set "showSidebar" false }} {{ $.Scratch.Set "showSidebar" false }}
{{ with $secondLevel }} {{ with $secondLevel }}
+1 -1
View File
@@ -13,8 +13,8 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "docs-nav.html" . }}
<div class="wrapper"> <div class="wrapper">
{{ partial "docs-nav.html" . }}
{{ $secondLevel := ($.Scratch.Get "secondLevel") }} {{ $secondLevel := ($.Scratch.Get "secondLevel") }}
{{ $.Scratch.Set "showSidebar" false }} {{ $.Scratch.Set "showSidebar" false }}
{{ with $secondLevel }} {{ with $secondLevel }}
+22 -17
View File
@@ -11,10 +11,11 @@
{{end}} {{end}}
{{end}} {{end}}
<nav class="row middle-xs between-xs"> <nav class="bg-default">
<div class="pull-left p-v-xs col-md-2s"> <div class="wrapper row middle-xs">
<div class="p-v-xs">
<ul class="dropdown sub-menu unstyled"> <ul class="dropdown sub-menu unstyled">
<li> <li class="m-b-0">
<a href="{{ ($.Scratch.Get "topLevel").Permalink }}" class="btn bg-link p-a-0"> <a href="{{ ($.Scratch.Get "topLevel").Permalink }}" class="btn bg-link p-a-0">
<span class="p-h-xs"> <span class="p-h-xs">
{{ range $product := $.Site.Sections }} {{ range $product := $.Site.Sections }}
@@ -36,9 +37,9 @@
{{ range $product := $.Site.Sections }} {{ range $product := $.Site.Sections }}
{{ range $version := .Sections }} {{ range $version := .Sections }}
{{ range $language := .Sections }} {{ range $language := .Sections }}
<li><a href="{{ .Permalink }}">{{ .Params.shortTitle }}</a></li> <li class="m-b-0"><a href="{{ .Permalink }}">{{ .Params.shortTitle }}</a></li>
{{ if .Params.insertonesix }} {{ if .Params.insertonesix }}
<li><a href="https://rancher.com/docs/rancher/v1.6/en/" target="blank">Rancher 1.6</a></li> <li class="m-b-0"><a href="https://rancher.com/docs/rancher/v1.6/en/" target="blank">Rancher 1.6</a></li>
{{end}} {{end}}
{{end}} {{end}}
{{end}} {{end}}
@@ -49,18 +50,22 @@
</ul> </ul>
</div> </div>
<!-- tabs --> <!-- top level nav -->
<ul class="tabs col-md-10"> <nav>
{{ $topLevel := .Scratch.Get "topLevel"}} <ul class="row unstyled">
{{ if $topLevel }} {{ $topLevel := .Scratch.Get "topLevel"}}
{{ range $topLevel.Sections }} {{ if $topLevel }}
{{ $isCurrent := .IsAncestor $.CurrentSection }} {{ range $topLevel.Sections }}
{{ if $isCurrent }} {{ $isCurrent := .IsAncestor $.CurrentSection }}
{{ $.Scratch.Set "secondLevel" . }} {{ if $isCurrent }}
{{ end }} {{ $.Scratch.Set "secondLevel" . }}
{{ end }}
<li class="{{if $isCurrent}}active{{end}}"><a href="{{ .Permalink }}">{{ .Title }}</a></li> <li class="{{if $isCurrent}}active{{end}} p-a-xs m-b-0"><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }} {{ end }}
{{ end }} </ul>
</ul> </nav>
</div>
</nav> </nav>