Skip to content

Commit 4b2ce02

Browse files
committed
Fix Paging
1 parent 2715edd commit 4b2ce02

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

_includes/footer_custom.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
{%- if current_index >= 0 -%}
2323
{%- assign previous_page = nil -%}
2424
{%- assign next_page = nil -%}
25+
{%- assign current_children = nav_pages | where: "parent", page.title | sort_natural: "title" | sort: "nav_order" -%}
2526

2627
{%- if current_index > 0 -%}
2728
{%- assign previous_index = current_index | minus: 1 -%}
@@ -35,6 +36,10 @@
3536
{%- assign next_page = pager_pages[next_index] -%}
3637
{%- endif -%}
3738

39+
{%- if page.has_children and current_children.size > 0 -%}
40+
{%- assign next_page = current_children.first -%}
41+
{%- endif -%}
42+
3843
{%- if previous_page or next_page -%}
3944
<nav class="page-nav" aria-label="Page navigation">
4045
{%- if previous_page -%}

0 commit comments

Comments
 (0)