Skip to content

Instantly share code, notes, and snippets.

@BryanSchuetz
Last active October 13, 2016 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BryanSchuetz/639af638a36eb5eaa5f2 to your computer and use it in GitHub Desktop.
Save BryanSchuetz/639af638a36eb5eaa5f2 to your computer and use it in GitHub Desktop.
Liquid: Siteleaf Next Navigation
{% if next.pages == empty %}
<p class="next">Next: <a href="{{ next.url }}">{{ next.title }}</a></p>
{% elsif next.pages.size > 0 %}
{% for page in next.pages limit:1 %}
<p class="next">Next: <a href="{{ page.url }}">{{ page.title }}</a></p>
{% endfor %}
{% elsif parent.next.pages == empty %}
<p class="next">Next: <a href="{{ parent.next.url }}">{{ parent.next.title }}</a></p>
{% elsif parent.next.pages.size > 0 %}
{% for page in parent.next.pages limit:1 %}
<p class="next">Next: <a href="{{ page.url }}">{{ page.title }}</a></p>
{% endfor %}
{% else %}
<p class="next">Next: <a href="/">Home</a></p>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment