#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

View file

@ -118,6 +118,11 @@ ul.pagination {
a.active { a.active {
color: $color-link; color: $color-link;
} }
a.collapsed::after {
content: "";
margin-left: $padding-8;
}
} }
.book-section-flat { .book-section-flat {

View file

@ -1 +1 @@
{"Target":"book.min.33dd7934182d4abfe269db67d0d9821bdd866c149d8327944bc47573db5a4d82.css","MediaType":"text/css","Data":{"Integrity":"sha256-M915NBgtSr/iadtn0NmCG92GbBSdgyeUS8R1c9taTYI="}} {"Target":"book.min.829f7602029a29a47bf1b0c9c4bb52982089a6d13558c9433d3c8b7e38c8b3b8.css","MediaType":"text/css","Data":{"Integrity":"sha256-gp92AgKaKaR78bDJxLtSmCCJptE1WMlDPTyLfjjIs7g="}}

View file

@ -23,13 +23,8 @@
{{ define "book-section" }} {{ define "book-section" }}
{{ with .Section }} {{ with .Section }}
<li {{ if .Params.BookFlatSection }} class="book-section-flat" {{ end }}> <li {{- if .Params.BookFlatSection }} class="book-section-flat" {{ end }}>
{{ if .Content }}
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }} {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
{{ else }}
<span>{{ partial "docs/title" . }}</span>
{{ end }}
{{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }} {{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }}
</li> </li>
{{ end }} {{ end }}
@ -59,8 +54,14 @@
{{ define "book-page-link" }} {{ define "book-page-link" }}
{{ with .Page }} {{ with .Page }}
<a href="{{ .RelPermalink }}" {{ if eq $.CurrentPage . }} class="active"{{ end }}> {{ if .Content }}
{{ partial "docs/title" . }} <a href="{{ .RelPermalink }}" class="
{{- if .Params.bookCollapseSection }}collapsed {{ end }}
{{- if eq $.CurrentPage . }}active{{ end }}">
{{- partial "docs/title" . -}}
</a> </a>
{{ else }}
<span>{{- partial "docs/title" . -}}</span>
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}