Skip to content

Commit

Permalink
arrownav: fix for hidden pages #685
Browse files Browse the repository at this point in the history
two consecutive hidden siblings resulted in wrong next page
  • Loading branch information
McShelby committed Sep 14, 2024
1 parent aa01d07 commit f41e0a0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions layouts/partials/_relearn/pageNext.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit f41e0a0

Please sign in to comment.