website/themes/book/layouts/partials/docs/menu-filetree.html
{{ $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) */}}
{{ range (where .Section.Pages "Params.bookhidden" "ne" true) }} {{ if .IsSection }} - {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }} {{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }} {{ else if and .IsPage .Content }} - {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }} {{ end }} {{ end }} {{ end }} {{ define "book-page-link" }}{{/* (dict "Page" .Page "CurrentPage" .CurrentPage) */}} {{ $current := eq .CurrentPage .Page }} {{ $ancestor := .Page.IsAncestor .CurrentPage }} {{ if .Page.Params.bookCollapseSection }} {{- partial "docs/title" .Page -}} {{ else if .Page.Content }} {{- partial "docs/title" .Page -}} {{ else }} {{- partial "docs/title" .Page -}} {{ end }} {{ end }}