Fix current page highlight in new Hugo version
This commit is contained in:
parent
831e570f16
commit
a9867292af
1 changed files with 3 additions and 3 deletions
|
@ -38,9 +38,9 @@
|
||||||
{{ with .Section }}
|
{{ with .Section }}
|
||||||
<ul>
|
<ul>
|
||||||
{{ range where .Pages "Params.bookhidden" "!=" "true" }}
|
{{ range where .Pages "Params.bookhidden" "!=" "true" }}
|
||||||
{{ if eq .Kind "section" }}
|
{{ if .IsSection }}
|
||||||
{{ template "book-section" (dict "Section" . "CurrentPage" $.CurrentPage) }}
|
{{ template "book-section" (dict "Section" . "CurrentPage" $.CurrentPage) }}
|
||||||
{{ else if and (eq .Kind "page") .Content }}
|
{{ else if and .IsPage .Content }}
|
||||||
<li>
|
<li>
|
||||||
{{- template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) -}}
|
{{- template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) -}}
|
||||||
</li>
|
</li>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
{{ if .Content }}
|
{{ if .Content }}
|
||||||
<a href="{{ .RelPermalink }}" class="
|
<a href="{{ .RelPermalink }}" class="
|
||||||
{{- if and .Params.bookCollapseSection .IsSection }}collapsed {{ end }}
|
{{- if and .Params.bookCollapseSection .IsSection }}collapsed {{ end }}
|
||||||
{{- if eq $.CurrentPage . }}active{{ end }}">
|
{{- if eq $.CurrentPage.RelPermalink .RelPermalink }}active{{ end }}">
|
||||||
{{- partial "docs/title" . -}}
|
{{- partial "docs/title" . -}}
|
||||||
</a>
|
</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|
Loading…
Reference in a new issue