Nav fixes

This commit is contained in:
Vincent Fiduccia
2018-04-30 12:09:56 -07:00
parent f350061195
commit 81cd32fa07
4 changed files with 28 additions and 16 deletions
+9 -3
View File
@@ -8,16 +8,22 @@
{{ define "main" }}
<div class="wrapper">
{{ partial "docs-nav.html" . }}
{{ $showSidebar := (gt (len ($.Scratch.Get "secondLevel").Sections) 0) }}
{{ $secondLevel := ($.Scratch.Get "secondLevel") }}
{{ $.Scratch.Set "showSidebar" false }}
{{ with $secondLevel }}
{{ if (gt (len .Sections) 0) }}
{{ $.Scratch.Set "showSidebar" true }}
{{end}}
{{end}}
<div class="row m-t-sm">
{{ if $showSidebar }}
{{ if ($.Scratch.Get "showSidebar") }}
<aside class="col-sm-3 col-xs-12">
{{ partial "docs-side-nav.html" . }}
</aside>
{{end}}
<article class="{{ if $showSidebar }} col-sm-6 {{else}} col-md-9 p-r-lg {{end}} col-xs-12">
<article class="{{ if ($.Scratch.Get "showSidebar") }} col-sm-6 {{else}} col-md-9 p-r-lg {{end}} col-xs-12">
<div class="main-content ">
+9 -3
View File
@@ -1,16 +1,21 @@
{{ $.Scratch.Set "topLevel" . }}
{{ $.Scratch.Set "secondLevel" . }}
{{ range .Site.Sections }}
{{if $.CurrentSection}}
{{ if .IsAncestor $.CurrentSection }}
{{ $.Scratch.Set "topLevel" . }}
{{end}}
{{end}}
{{end}}
<nav class="row middle-xs between-xs">
<div class="pull-left p-v-xs col-md-2s">
<ul class="dropdown sub-menu unstyled">
<li>
<a href="{{ .URL }}" 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">
{{ range .Site.Sections }}
{{if $.CurrentSection}}
{{ if .IsAncestor $.CurrentSection }}
{{ $.Scratch.Set "topLevel" . }}
{{ .Params.shortTitle }}
{{end}}
{{end}}
@@ -32,6 +37,7 @@
<!-- tabs -->
<ul class="tabs col-md-10">
{{ $topLevel := .Scratch.Get "topLevel"}}
<li class="{{if (eq .Permalink $topLevel.Permalink)}}active{{end}}"><a href="{{$topLevel.Permalink}}"><i class="material-icons" style="position: relative; top: -2px;">home</i></a></li>
{{ if $topLevel }}
{{ range $topLevel.Sections }}
{{ $isCurrent := .IsAncestor $.CurrentSection }}