From 5cc3d6719cd596c9828c8dce5e9a9e934f333f93 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Mon, 14 Sep 2020 22:45:31 +0200 Subject: #231, Allow open collapsed menu without changing page --- layouts/partials/docs/menu-filetree.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'layouts/partials') diff --git a/layouts/partials/docs/menu-filetree.html b/layouts/partials/docs/menu-filetree.html index fcde91e..3ca9db2 100644 --- a/layouts/partials/docs/menu-filetree.html +++ b/layouts/partials/docs/menu-filetree.html @@ -8,11 +8,6 @@ {{ end }} {{ define "book-section-children" }}{{/* (dict "Section" .Section "CurrentPage" .CurrentPage) */}} - {{ $self := eq .CurrentPage .Section }} - {{ $ancestor := .Section.IsAncestor .CurrentPage }} - {{ $collapsed := .Section.Params.bookCollapseSection }} - - {{ if or $self $ancestor (not $collapsed) }} - {{ end }} {{ end }} {{ define "book-page-link" }}{{/* (dict "Page" .Page "CurrentPage" .CurrentPage) */}} - {{ if .Page.Content }} - + {{ $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 }} -- cgit v1.2.3