From 561659ed53a1eb1e7583513af5fa2faba55fca7e Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Mon, 17 Sep 2018 18:29:36 +0200 Subject: Improve page title handling and side menu templates --- layouts/partials/docs/html-head.html | 1 + layouts/partials/docs/nav-filetree.html | 55 +++++++++++++++------------------ layouts/partials/docs/shared.html | 11 +++++++ 3 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 layouts/partials/docs/shared.html (limited to 'layouts/partials') diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html index ecf8a4c..e77c218 100644 --- a/layouts/partials/docs/html-head.html +++ b/layouts/partials/docs/html-head.html @@ -1,5 +1,6 @@ +{{- template "title" . }} | {{ .Site.Title -}} diff --git a/layouts/partials/docs/nav-filetree.html b/layouts/partials/docs/nav-filetree.html index c5ecfc8..7c80ae2 100644 --- a/layouts/partials/docs/nav-filetree.html +++ b/layouts/partials/docs/nav-filetree.html @@ -1,15 +1,5 @@ -{{ $bookSection := default "docs" .Site.Params.BookSection }} -{{ if eq $bookSection "*" }} - {{ .Scratch.Set "BookSections" .Site.Sections }} -{{ else }} - {{ $bookSections := where .Site.Sections "Section" $bookSection }} - {{ .Scratch.Set "BookSections" $bookSections }} - - {{ if eq (len $bookSections) 1 }} - {{ $singleSection := index $bookSections 0 }} - {{ .Scratch.Set "BookSections" $singleSection.Sections }} - {{ end }} -{{ end }} + +{{ template "book-get-root-section" . }}