mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
arrownav: fix for hidden pages #685
two consecutive hidden siblings resulted in wrong next page
This commit is contained in:
parent
d3f9f87ed5
commit
415d3a4c60
1 changed files with 14 additions and 3 deletions
|
@ -52,13 +52,24 @@
|
|||
{{- $parent := . }}
|
||||
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" $parent) $parent.Path }}
|
||||
{{- $nextVisible := partial "inline/next_sibling" (dict "siblings" $pages "currentNode" $currentNode) }}
|
||||
{{- if $nextVisible }}
|
||||
{{- range $pages }}
|
||||
{{- if not $nextVisible }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- $nextSibling = partial "inline/leftmost_descendant" $nextVisible }}
|
||||
{{- if $nextSibling }}
|
||||
{{- break }}
|
||||
{{- else }}
|
||||
{{- $nextVisible = partial "inline/next_sibling" (dict "siblings" $pages "currentNode" $nextVisible) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if not $nextSibling }}
|
||||
{{- if $nextVisible }}
|
||||
{{- $nextSibling = partial "inline/leftmost_descendant" $nextVisible }}
|
||||
{{- end }}
|
||||
{{- if not $nextSibling }}
|
||||
{{- $nextSibling = partial "inline/next_sibling_or_ancestor" $parent }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $nextSibling = partial "inline/next_sibling_or_ancestor" $parent }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- return $nextSibling }}
|
||||
|
|
Loading…
Reference in a new issue