{{ $pages := slice }} {{ if eq .Section "apps" }} {{ $pages = (site.GetPage "/apps").Pages.ByTitle }} {{ else }} {{ with .CurrentSection }}{{ $pages = .Pages.ByWeight }}{{ end }} {{ end }} {{ if and $pages (not .IsSection) }} {{ $prev := $pages.Prev . }} {{ $next := $pages.Next . }} {{/* Pages.Next/Prev are reversed relative to reading order */}} {{ end }}