{{ $all := slice }} {{ range (site.GetPage "/docs").Sections.ByWeight }} {{ range .RegularPages.ByWeight }}{{ $all = $all | append . }}{{ end }} {{ range .Sections.ByWeight }}{{ range .RegularPages.ByWeight }}{{ $all = $all | append . }}{{ end }}{{ end }} {{ end }} {{ range (site.GetPage "/docs").RegularPages.ByWeight }}{{ $all = $all | append . }}{{ end }} {{ $idx := -1 }} {{ range $i, $p := $all }}{{ if eq $p.RelPermalink $.RelPermalink }}{{ $idx = $i }}{{ end }}{{ end }} {{ if ge $idx 0 }} {{ end }}