Fix for random failures in menu generation

This commit is contained in:
Gennady Pospelov 2018-01-17 17:52:56 +01:00
parent 6562adeb7b
commit 12cab1bed6

View file

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