aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2020-02-29 21:15:52 +0100
committerAlex Shpak <alex-shpak@users.noreply.github.com>2020-02-29 21:15:52 +0100
commit6ecc94ed2bf6c7c3b89be7d2dffe47f5202988ea (patch)
tree083c6df02ec0cdcf82b41fd5960f7084166e883d /layouts/partials/docs
parenta722f74fba012dd75a1785f00293dd040a32e48a (diff)
#155, Add expand indicator in collapsed section
Diffstat (limited to 'layouts/partials/docs')
-rw-r--r--layouts/partials/docs/menu-filetree.html19
1 files changed, 10 insertions, 9 deletions
diff --git a/layouts/partials/docs/menu-filetree.html b/layouts/partials/docs/menu-filetree.html
index 30fc2ce..24bf5b5 100644
--- a/layouts/partials/docs/menu-filetree.html
+++ b/layouts/partials/docs/menu-filetree.html
@@ -23,13 +23,8 @@
{{ define "book-section" }}
{{ with .Section }}
- <li {{ if .Params.BookFlatSection }} class="book-section-flat" {{ end }}>
- {{ if .Content }}
- {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
- {{ else }}
- <span>{{ partial "docs/title" . }}</span>
- {{ end }}
-
+ <li {{- if .Params.BookFlatSection }} class="book-section-flat" {{ end }}>
+ {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
{{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }}
</li>
{{ end }}
@@ -59,8 +54,14 @@
{{ define "book-page-link" }}
{{ with .Page }}
- <a href="{{ .RelPermalink }}" {{ if eq $.CurrentPage . }} class="active"{{ end }}>
- {{ partial "docs/title" . }}
+ {{ if .Content }}
+ <a href="{{ .RelPermalink }}" class="
+ {{- if .Params.bookCollapseSection }}collapsed {{ end }}
+ {{- if eq $.CurrentPage . }}active{{ end }}">
+ {{- partial "docs/title" . -}}
</a>
+ {{ else }}
+ <span>{{- partial "docs/title" . -}}</span>
+ {{ end }}
{{ end }}
{{ end }}