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