{{ $bookSection := default "docs" .Site.Params.BookSection }} {{ if eq $bookSection "*" }} {{ $bookSection = "/" }}{{/* Backward compatibility */}} {{ end }} {{ with .Site.GetPage $bookSection }} {{ template "book-section-children" (dict "Section" . "CurrentPage" $) }} {{ end }} {{ define "book-section-children" }}{{/* (dict "Section" .Section "CurrentPage" .CurrentPage) */}} {{ end }} {{ define "book-page-link" }}{{/* (dict "Page" .Page "CurrentPage" .CurrentPage) */}} {{ $current := eq .CurrentPage .Page }} {{ $ancestor := .Page.IsAncestor .CurrentPage }} {{ if .Page.Params.BookCollapseSection }} {{ else if .Page.Params.BookHref }} {{ template "book-icon-title" .Page -}} {{ else if .Page.Content }} {{ template "book-icon-title" .Page -}} {{ else }} {{ template "book-icon-title" .Page -}} {{ end }} {{ end }} {{ define "book-icon-title" }} {{- with .Page.Params.BookIcon -}} {{ partial {{- end -}} {{- partial "docs/title" .Page -}} {{ end }}