Merge pull request #105 from gpospelov/master

Bug fix in sidebar menu and children description generation
This commit is contained in:
Mathieu Cornic 2018-01-17 22:10:33 +01:00 committed by GitHub
commit 1aee7f25bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -111,11 +111,11 @@
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
{{ if ne $numberOfPages 0 }}
<ul>
{{ .Scratch.Set "pages" .Pages }}
{{ $currentNode.Scratch.Set "pages" .Pages }}
{{ if .Sections}}
{{ .Scratch.Set "pages" (.Pages | union .Sections) }}
{{ $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
{{end}}
{{ $pages := (.Scratch.Get "pages") }}
{{ $pages := ($currentNode.Scratch.Get "pages") }}
{{if eq .Site.Params.ordersectionsby "title"}}
{{ range $pages.ByTitle }}

View file

@ -67,11 +67,11 @@
{{if eq $.style "li"}}
<ul>
{{end}}
{{ .Scratch.Set "pages" .Pages }}
{{ $.Page.Scratch.Set "pages" .Pages }}
{{ if .Sections}}
{{ .Scratch.Set "pages" (.Pages | union .Sections) }}
{{ $.Page.Scratch.Set "pages" (.Pages | union .Sections) }}
{{end}}
{{ $pages := (.Scratch.Get "pages") }}
{{ $pages := ($.Page.Scratch.Get "pages") }}
{{if eq $.sortTerm "Weight"}}
{{template "childs" dict "menu" $pages.ByWeight "style" $.style "showhidden" $.showhidden "count" (add $.count 1) "depth" $.depth "pages" $.pages "description" $.description "sortTerm" $.sortTerm}}