diff options
author | Paul Twohey <twohey@users.noreply.github.com> | 2019-08-28 21:53:19 -0700 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-09-04 16:09:55 +0200 |
commit | 7d0ee68c3b2b32178b921d1453924e66100d4ec1 (patch) | |
tree | aac0fce706b07c680ad2bd5acc353d215fc861c8 /layouts | |
parent | 64dfdf39fbf6fce86ab3105e07d9130630372f35 (diff) |
Fixes #69 Make file based menus behave as expected
- Fixes #69
- Section headings are listed once
- Sections and normal pages sort with the same weights amongst themselves
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/docs/menu-filetree.html | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/layouts/partials/docs/menu-filetree.html b/layouts/partials/docs/menu-filetree.html index abc6fd9..c8dd86b 100644 --- a/layouts/partials/docs/menu-filetree.html +++ b/layouts/partials/docs/menu-filetree.html @@ -38,13 +38,14 @@ {{ define "book-section-children" }} {{ with .Section }} <ul> - {{ range where .Sections "Params.bookhidden" "!=" true }} - {{ template "book-section" (dict "Section" . "CurrentPage" $.CurrentPage) }} - {{ end }} - {{ range where .Pages "Params.bookhidden" "!=" true }} - <li> - {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }} - </li> + {{ range where .Pages "Params.bookhidden" "!=" "true" }} + {{ if eq .Kind "section" }} + {{ template "book-section" (dict "Section" . "CurrentPage" $.CurrentPage) }} + {{ else if and (eq .Kind "page") .Content }} + <li> + {{- template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) -}} + </li> + {{ end }} {{ end }} </ul> {{ end }} |