layout and style changes

This commit is contained in:
lvuch
2018-06-25 16:13:46 -07:00
parent 27710f5a0c
commit dee302a63c
3 changed files with 91 additions and 45 deletions
+25 -21
View File
@@ -4,7 +4,22 @@
{{ define "hero" }}
<section class="hero">
<h1>Rancher Docs</h1>
<h5 class="text-white">
{{ range $product := $.Site.Sections }}
{{ range $version := .Sections }}
{{ range $language := .Sections }}
{{if $.CurrentSection}}
{{ if .IsAncestor $.CurrentSection }}
{{ .Params.shortTitle }}
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
</h5>
{{ with .Params.Title }}
<h1 class="m-t-0">{{ . }}</h1>
{{end}}
{{ with .Params.Author }}
<span class="byline bg-link">{{ . }}</span>
@@ -13,29 +28,18 @@
{{ end }}
{{ define "main" }}
<div class="wrapper">
{{ 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}}
<div class="wrapper">
<div class="row m-t-sm">
{{ if ($.Scratch.Get "showSidebar") }}
<aside class="col-sm-3 col-xs-12 p-l-0">
{{ partial "docs-side-nav.html" . }}
</aside>
{{end}}
<article class="{{ if ($.Scratch.Get "showSidebar") }} col-sm-7 {{else}} col-md-9 p-r-lg {{end}} col-xs-12">
<aside class="col-sm-3 col-xs-12 p-l-0">
{{ partial "docs-side-nav.html" . }}
</aside>
<article class="{{ if ($.Scratch.Get "showSidebar") }} col-sm-6 {{else}} col-md-9 p-r-lg {{end}} col-xs-12">
<div class="main-content ">
{{ with .Params.Title }}
<h2 class="m-t-0">{{ . }}</h2>
{{end}}
{{ .Content }}
{{ range (.Paginator 5).Pages }}
@@ -92,13 +96,13 @@
<div class="p-v-xs">{{ partial "page-edit.html" . }}</div>
</article>
{{ with .TableOfContents }}
<!-- {{ with .TableOfContents }}
<div class="offset-watch invisible"></div>
<aside class="col-sm-2 col-xs-12 unstyled toc-container hidden-md">
<h4 class="m-b-0">On this page</h4>
{{ . }}
</aside>
{{ end }}
{{ end }} -->
</div>
</div>
{{ end }}
+14 -22
View File
@@ -4,7 +4,10 @@
{{ define "hero" }}
<section class="hero">
<h1>Rancher Docs</h1>
<h5 class="text-white">Rancher 2.0 Docs</h5>
{{ with .Params.Title }}
<h1 class="m-t-0">{{ . }}</h1>
{{end}}
{{ with .Params.Author }}
<span class="byline bg-link">{{ . }}</span>
@@ -13,40 +16,29 @@
{{ end }}
{{ define "main" }}
<div class="wrapper">
{{ 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}}
<div class="wrapper">
<div class="row m-t-sm">
{{ if ($.Scratch.Get "showSidebar") }}
<aside class="col-sm-3 col-xs-12 p-l-0">
{{ partial "docs-side-nav.html" . }}
</aside>
{{end}}
<article class="{{ if ($.Scratch.Get "showSidebar") }} col-sm-7 {{else}} col-md-9 p-r-lg {{end}} col-xs-12">
<aside class="col-sm-3 col-xs-12 p-l-0">
{{ partial "docs-side-nav.html" . }}
</aside>
<article class="{{ if ($.Scratch.Get "showSidebar") }} col-sm-6 {{else}} col-md-9 p-r-lg {{end}} col-xs-12">
<div class="main-content ">
{{ with .Params.Title }}
<h2 class="m-t-0">{{ . }}</h2>
{{end}}
{{ .Content }}
</div>
<div class="p-v-sm">{{ partial "page-edit.html" . }}</div>
</article>
<div class="offset-watch invisible"></div>
<aside class="col-sm-2 col-xs-12 unstyled toc-container">
<!-- <div class="offset-watch invisible"></div>
<aside class="col-sm-3 col-xs-12 unstyled toc-container">
<h4 class="m-b-0">On this page</h4>
{{ .TableOfContents }}
</aside>
</aside> -->
</div>
</div>
+52 -2
View File
@@ -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}}
<!-- product dropdown -->
<ul class="dropdown sub-menu unstyled">
<li class="m-b-0">
<a href="{{ ($.Scratch.Get "topLevel").Permalink }}" class="btn bg-link p-a-0">
<span class="p-h-xs">
{{ range $product := $.Site.Sections }}
{{ range $version := .Sections }}
{{ range $language := .Sections }}
{{if $.CurrentSection}}
{{ if .IsAncestor $.CurrentSection }}
{{ .Params.shortTitle }}
{{end}}
{{end}}
{{end}}
{{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 $product := $.Site.Sections }}
{{ range $version := .Sections }}
{{ range $language := .Sections }}
<li class="m-b-0"><a href="{{ .Permalink }}">{{ .Params.shortTitle }}</a></li>
{{ if .Params.insertonesix }}
<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}}
</ul>
</li>
</ul>
<div class="tree-nav invisible">
<ul>
{{ template "section-tree-nav" ($.Scratch.Get "secondLevel") }}
<!-- {{ template "section-tree-nav" ($.Scratch.Get "secondLevel") }} -->
{{ template "section-tree-nav" ($.Scratch.Get "topLevel") }}
</ul>
</div>
{{ define "section-tree-nav" }}
{{ range .Sections}}
<li class="tree-nav-item"><a href="{{ .RelPermalink}}">{{ .Title }}</a>
{{if gt (len .Sections) 0}}
<i class="material-icons pull-right expand-toggle">add_box</i>
<i class="material-icons 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>