diff --git a/_layouts/default.html b/_layouts/default.html index 34132f4..eb149d4 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -85,40 +85,51 @@

{{ page.description | default: site.description | de
+ {% assign sibling_count = 0 %} + {% assign section_home = nil %} + {% assign prev_page = nil %} + {% assign next_page = nil %} {% if page.path contains 'docs/' and page.path != 'docs/README.md' %} - {% assign sibling_pages = site.pages | where_exp: "item", "item.path contains 'docs/' and item.path contains '.md' and item.dir == page.dir" | sort: "url" %} - {% assign section_home = sibling_pages | where_exp: "item", "item.name == 'README.md'" | first %} - {% assign prev_page = nil %} - {% assign next_page = nil %} + {% assign section_pages = site.pages | where: "dir", page.dir | sort: "url" %} {% assign seen_current = false %} - {% for item in sibling_pages %} - {% if item.url == page.url %} - {% assign seen_current = true %} - {% elsif seen_current and next_page == nil %} - {% assign next_page = item %} - {% elsif seen_current == false %} - {% assign prev_page = item %} + {% for item in section_pages %} + {% if item.path contains 'docs/' and item.path contains '.md' %} + {% assign sibling_count = sibling_count | plus: 1 %} + {% if item.name == 'README.md' %} + {% assign section_home = item %} + {% endif %} + {% if item.url == page.url %} + {% assign seen_current = true %} + {% elsif seen_current == false %} + {% assign prev_page = item %} + {% elsif next_page == nil %} + {% assign next_page = item %} + {% endif %} {% endif %} {% endfor %}