Simplify partials
This commit is contained in:
parent
ca37d7488c
commit
80cca5b1be
4 changed files with 29 additions and 36 deletions
|
@ -10,7 +10,18 @@
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
|
|
||||||
<div class="pure-u book-nav">
|
<div class="pure-u book-nav">
|
||||||
{{ partial "docs/nav" . }}
|
<nav role="navigation">
|
||||||
|
{{ partial "docs/nav-brand" . }}
|
||||||
|
{{ partial "docs/inject/nav-before" . }}
|
||||||
|
|
||||||
|
{{ if .Site.Params.BookMenuBundle }}
|
||||||
|
{{ partial "docs/nav-bundle" . }}
|
||||||
|
{{ else }}
|
||||||
|
{{ partial "docs/nav-filetree" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partial "docs/inject/nav-after" . }}
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u book-content">
|
<div class="pure-u book-content">
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
<nav role="navigation">
|
|
||||||
{{ partial "docs/nav-brand" . }}
|
|
||||||
{{ partial "docs/inject/nav-before" . }}
|
|
||||||
{{ with .Site.GetPage .Site.Params.BookMenuBundle }}
|
{{ with .Site.GetPage .Site.Params.BookMenuBundle }}
|
||||||
{{- .Content -}}
|
{{- .Content -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ partial "docs/inject/nav-after" . }}
|
|
||||||
</nav>
|
|
||||||
|
|
|
@ -9,22 +9,14 @@
|
||||||
{{ $singleSection := index $bookSections 0 }}
|
{{ $singleSection := index $bookSections 0 }}
|
||||||
{{ .Scratch.Set "BookSections" $singleSection.Sections }}
|
{{ .Scratch.Set "BookSections" $singleSection.Sections }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<nav role="navigation">
|
|
||||||
{{ partial "docs/nav-brand" . }}
|
|
||||||
{{ partial "docs/inject/nav-before" . }}
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Scratch.Get "BookSections" }}
|
{{ range .Scratch.Get "BookSections" }}
|
||||||
{{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
|
{{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ partial "docs/inject/nav-after" . }}
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<!-- Single section of menu (recursive) -->
|
<!-- Single section of menu (recursive) -->
|
||||||
{{ define "book-section" }}
|
{{ define "book-section" }}
|
||||||
<li {{ if .Section.Params.booktopsection }}class="book-nav-section"{{ end }}>
|
<li {{ if .Section.Params.booktopsection }}class="book-nav-section"{{ end }}>
|
|
@ -1,5 +0,0 @@
|
||||||
{{ if .Site.Params.BookMenuBundle }}
|
|
||||||
{{ partial "docs/nav-bundle" . }}
|
|
||||||
{{ else }}
|
|
||||||
{{ partial "docs/nav-tree" . }}
|
|
||||||
{{ end }}
|
|
Loading…
Reference in a new issue