#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 {
color: $color-link;
}
a.collapsed::after {
content: "";
margin-left: $padding-8;
}
}
.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" }}
{{ with .Section }}
<li {{ if .Params.BookFlatSection }} class="book-section-flat" {{ end }}>
{{ if .Content }}
<li {{- if .Params.BookFlatSection }} class="book-section-flat" {{ end }}>
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
{{ else }}
<span>{{ partial "docs/title" . }}</span>
{{ end }}
{{ 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 }}