mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-28 14:08:55 +00:00
more menu setup
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
{{ define "hero" }}
|
||||
<section class="hero">
|
||||
<div class="wrapper p-h-lg row center-xs">
|
||||
<div class="col-md-8">
|
||||
{{ with .Params.Title }}
|
||||
<h1>{{ . }}</h1>
|
||||
{{end}}
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<span class="byline bg-link">{{ . }}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<div class="wrapper">
|
||||
<h1>default single template</h1>
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<div class="row">
|
||||
<article class="main-content col-sm-8 col-xs-12 p-r-lg">
|
||||
|
||||
{{ if .Params.Image }}
|
||||
<img class="feat-img" src="{{ .Params.Image }}" alt="{{ .Params.Title }}">
|
||||
{{end}}
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
</article>
|
||||
|
||||
<aside class="col-sm-4 col-xs-12">
|
||||
{{ partial "sidebar.html" . }}
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -3,7 +3,6 @@
|
||||
{{ end }}
|
||||
|
||||
{{ define "hero" }}
|
||||
<!-- theme/layouts/_default/list.html-->
|
||||
<section class="hero">
|
||||
{{ with .Params.Title }}
|
||||
<h1>{{ . }}</h1>
|
||||
@@ -28,7 +27,7 @@
|
||||
{{ partial "docs-side-nav.html" . }}
|
||||
</div>
|
||||
</aside>
|
||||
<article class="col-sm-8 col-xs-12 p-r-lg">
|
||||
<article class="col-sm-8 col-xs-12 p-l-lg">
|
||||
<div class="main-content ">
|
||||
|
||||
{{ .Content }}
|
||||
@@ -67,10 +66,6 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
<!-- {{ with .Params.Date }}
|
||||
<div class="p-h-sm p-v-xs"><i class="material-icons">event</i> By: {{ .Format "January 2, 2006" }}</div>
|
||||
{{end}} -->
|
||||
|
||||
{{ if eq .Section "blog" }}
|
||||
<div class="p-h-sm p-v-xs"><i class="material-icons">timer</i> Read Time: {{.ReadingTime}} minutes</div>
|
||||
{{end}}
|
||||
|
||||
@@ -1,37 +1,85 @@
|
||||
{{ define "title" }}
|
||||
{{ .Title }} – {{ .Site.Title }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "hero" }}
|
||||
<section class="hero">
|
||||
<div class="wrapper p-h-lg row center-xs">
|
||||
<div class="col-md-8">
|
||||
{{ with .Params.Title }}
|
||||
<h1>{{ . }}</h1>
|
||||
{{end}}
|
||||
<section class="hero">
|
||||
{{ with .Params.Title }}
|
||||
<h1>{{ . }}</h1>
|
||||
{{end}}
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<span class="byline bg-link">{{ . }}</span>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<span class="byline bg-link">{{ . }}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<div class="wrapper">
|
||||
<h1>default single template</h1>
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<div class="row">
|
||||
<article class="main-content col-sm-8 col-xs-12 p-r-lg">
|
||||
|
||||
{{ if .Params.Image }}
|
||||
<img class="feat-img" src="{{ .Params.Image }}" alt="{{ .Params.Title }}">
|
||||
{{end}}
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
</article>
|
||||
{{ partial "docs-nav.html" . }}
|
||||
|
||||
<div class="row m-t-sm">
|
||||
<aside class="col-sm-4 col-xs-12">
|
||||
{{ partial "sidebar.html" . }}
|
||||
<div class="bg-default p-a-sm">
|
||||
{{ partial "docs-side-nav.html" . }}
|
||||
</div>
|
||||
</aside>
|
||||
<article class="col-sm-8 col-xs-12 p-l-lg">
|
||||
<div class="main-content ">
|
||||
|
||||
{{ .Content }}
|
||||
{{ range (.Paginator 5).Pages }}
|
||||
<div class="box m-b-md">
|
||||
<div class="p-a-sm">
|
||||
<h3><a href="{{.URL}}">{{.Title}}</a></h3>
|
||||
|
||||
{{ if .Params.Image }}
|
||||
<div class="thumbnail"><img src="{{ .Params.Image }}" alt="{{ .Params.Title }}"></div>
|
||||
{{end}}
|
||||
|
||||
<p>{{ .Summary | safeHTML }}</p>
|
||||
{{ if .Truncated }}
|
||||
<div>
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="bg-default">
|
||||
<div class="row">
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<div class="p-h-sm p-v-xs"><i class="material-icons">person_outline</i> By: {{ . }}</div>
|
||||
{{end}}
|
||||
|
||||
{{ if eq .Section "events" }}
|
||||
{{ with .Params.EventDate }}
|
||||
<div class="p-h-sm p-v-xs"><i class="material-icons">event</i> {{ . }}</div>
|
||||
{{end}}
|
||||
|
||||
{{ else }}
|
||||
|
||||
{{ with .Params.Date }}
|
||||
<div class="p-h-sm p-v-xs"><i class="material-icons">event</i> {{ .Format "January 2, 2006" }}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{ if eq .Section "blog" }}
|
||||
<div class="p-h-sm p-v-xs"><i class="material-icons">timer</i> Read Time: {{.ReadingTime}} minutes</div>
|
||||
{{end}}
|
||||
|
||||
{{ with .Params.Location }}
|
||||
<div class="p-h-sm p-v-xs"><i class="material-icons">location_on</i> {{ . }}</div>
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
@@ -1,7 +1,41 @@
|
||||
{{ $.Scratch.Set "topLevel" . }}
|
||||
{{ $.Scratch.Set "secondLevel" . }}
|
||||
|
||||
<nav>
|
||||
<ul class="tabs">
|
||||
{{ range .Sections }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
<!-- tabs -->
|
||||
<ul class="tabs row middle-xs">
|
||||
<div class="pull-left m-v-sm">
|
||||
<ul class="dropdown sub-menu unstyled">
|
||||
<li>
|
||||
<a href="{{ .URL }}" class="btn bg-link p-a-0">
|
||||
<span class="p-h-xs">
|
||||
{{ range .Site.Sections }}
|
||||
{{ if .IsAncestor $.CurrentSection }}
|
||||
{{ $.Scratch.Set "topLevel" . }}
|
||||
{{ .Title }}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</span>
|
||||
<i class="material-icons darken p-a-xs">keyboard_arrow_down</i>
|
||||
</a>
|
||||
|
||||
<ul class="sub dropdown-menu bg-white unstyled">
|
||||
{{ range .Site.Sections }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ $topLevel := .Scratch.Get "topLevel"}}
|
||||
{{ if $topLevel }}
|
||||
{{ range $topLevel.Sections }}
|
||||
{{ if .IsAncestor $.CurrentSection }}
|
||||
{{ $.Scratch.Set "secondLevel" . }}
|
||||
{{ end }}
|
||||
|
||||
<li><a href="{{ .Permalink }}" class="">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -10,19 +10,20 @@
|
||||
{{ end }}
|
||||
-->
|
||||
<h3>{{ .Title }}</h3>
|
||||
{{ $home := .Site.Home }}
|
||||
|
||||
<div class="tree-nav">
|
||||
<ul>
|
||||
<!-- <li><a href="{{ .RelPermalink}}">Home</a></li> -->
|
||||
<ul>
|
||||
{{ template "section-tree-nav" $home }}
|
||||
{{ template "section-tree-nav" ($.Scratch.Get "secondLevel") }}
|
||||
}}
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
{{ define "section-tree-nav" }}
|
||||
{{ range .Sections}}
|
||||
<!-- <li> -->
|
||||
<li class="bg-white"><a href="{{ .RelPermalink}}"><i class="material-icons bg-accent p-a-xs">folder</i>{{ .Title }}<i class="material-icons pull-right">keyboard_arrow_down</i></a>
|
||||
<li class="bg-white"><a href="{{ .RelPermalink}}">{{ .Title }}<i class="material-icons pull-right">keyboard_arrow_down</i></a>
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li class="bg-white"><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
|
||||
|
||||
Reference in New Issue
Block a user