diff --git a/layouts/partials/docs/menu-filetree.html b/layouts/partials/docs/menu-filetree.html index 489a62f..4233a07 100644 --- a/layouts/partials/docs/menu-filetree.html +++ b/layouts/partials/docs/menu-filetree.html @@ -8,10 +8,11 @@ {{ end }} {{ define "book-section-children" }}{{/* (dict "Section" .Section "CurrentPage" .CurrentPage) */}} - {{ $ancestor := .Section.IsAncestor .CurrentPage }} + {{ $self := eq .CurrentPage .Section }} + {{ $ancestor := strings.HasPrefix .CurrentPage.RelPermalink .Section.RelPermalink }} {{ $collapsed := .Section.Params.bookCollapseSection }} - {{ if or $ancestor (not $collapsed) }} + {{ if or $self $ancestor (not $collapsed) }}