mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-27 13:38:07 +00:00
Nav
This commit is contained in:
@@ -3,16 +3,6 @@
|
||||
{{ end }}
|
||||
|
||||
{{ define "hero" }}
|
||||
<section class="hero">
|
||||
{{ with .Params.Title }}
|
||||
<h1>{{ . }}</h1>
|
||||
{{end}}
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<span class="byline bg-link">{{ . }}</span>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
||||
@@ -33,11 +33,12 @@
|
||||
{{ $topLevel := .Scratch.Get "topLevel"}}
|
||||
{{ if $topLevel }}
|
||||
{{ range $topLevel.Sections }}
|
||||
{{ if .IsAncestor $.CurrentSection }}
|
||||
{{ $isCurrent := .IsAncestor $.CurrentSection }}
|
||||
{{ if $isCurrent }}
|
||||
{{ $.Scratch.Set "secondLevel" . }}
|
||||
{{ end }}
|
||||
|
||||
<li><a href="{{ .Permalink }}" class="">{{ .Title }}</a></li>
|
||||
<li class="{{if $isCurrent}}active{{end}}"><a href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="tree-nav">
|
||||
<div class="tree-nav invisible">
|
||||
<ul>
|
||||
{{ template "section-tree-nav" ($.Scratch.Get "secondLevel") }}
|
||||
</ul>
|
||||
@@ -7,14 +7,12 @@
|
||||
{{ range .Sections}}
|
||||
<li class="tree-nav-item"><a href="{{ .RelPermalink}}">{{ .Title }}</a>
|
||||
{{if gt (len .Sections) 0}}
|
||||
<i class="material-icons pull-right expand-more">add_box</i>
|
||||
<i class="material-icons pull-right expand-toggle">add_box</i>
|
||||
<ul class="tree-nav-sublist hide">
|
||||
{{ range .Pages }}
|
||||
<li class="tree-nav-item-child"><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
|
||||
<li class="tree-nav-item-child"><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
<ul>
|
||||
{{ template "section-tree-nav" . }}
|
||||
</ul>
|
||||
{{ template "section-tree-nav" . }}
|
||||
</ul>
|
||||
{{end}}
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user