#155, Add expand indicator in collapsed section

This commit is contained in:
Alex Shpak
2020-02-29 21:15:52 +01:00
parent a722f74fba
commit 6ecc94ed2b
4 changed files with 17 additions and 11 deletions
+10 -9
View File
@@ -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 }}