mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-11 03:14:02 +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 := . }}
|
{{- $parent := . }}
|
||||||
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" $parent) $parent.Path }}
|
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" $parent) $parent.Path }}
|
||||||
{{- $nextVisible := partial "inline/next_sibling" (dict "siblings" $pages "currentNode" $currentNode) }}
|
{{- $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 }}
|
{{- $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 }}
|
{{- if not $nextSibling }}
|
||||||
{{- $nextSibling = partial "inline/next_sibling_or_ancestor" $parent }}
|
{{- $nextSibling = partial "inline/next_sibling_or_ancestor" $parent }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
|
||||||
{{- $nextSibling = partial "inline/next_sibling_or_ancestor" $parent }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- return $nextSibling }}
|
{{- return $nextSibling }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue