{{ $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.Content }} {{- partial "docs/title" .Page -}} {{ else if .Page.Params.bookHref }} {{- partial "docs/title" .Page -}} {{ else }} {{- partial "docs/title" .Page -}} {{ end }} {{ end }}