Skip to content

Commit

Permalink
Reapply "Update prev_next.liquid"
Browse files Browse the repository at this point in the history
This reverts commit 9004494.
  • Loading branch information
clausmullie committed Nov 23, 2024
1 parent d2526a3 commit 731f863
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion _includes/prev_next.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<span id="span-prev-next" class="theme-prev-next">
{% assign prev_order = page.order | minus:1 %}
{% assign next_order = page.order | plus:1 %}
{% assign sorted = site.pages | sort:"order" %}

{% assign url_parts = page.url | split: '/' %}
{% if url_parts[1] == 'criteria' %}
{% assign sorted = site.pages | sort:"order" %}
{% else %}
{% assign criteria_path = '/' | append: url_parts[1] | append: '/criteria/' %}
{% assign sorted = site.pages | where_exp: "page", "page.dir contains criteria_path" | sort:"order" %}
{% endif %}

{% for otherpage in sorted %}
{% if otherpage.order == prev_order %}
<span id="span-prev" class="theme-prev-next-prev"><a
Expand Down

0 comments on commit 731f863

Please sign in to comment.