Skip to content

Instantly share code, notes, and snippets.

@akdetrick
Last active December 18, 2015 03:09
Show Gist options
  • Select an option

  • Save akdetrick/5716438 to your computer and use it in GitHub Desktop.

Select an option

Save akdetrick/5716438 to your computer and use it in GitHub Desktop.
---
title: test
layout: main
---
<!-- declare order of pages by id -->
{% assign sassquatch_section_names = "index,test" | split: "," %}
<!-- loop through the ids -->
<h3>Pages by title in the order we declared them in sassquatch_section_names</h3>
<ul>
{% for pagetitle in sassquatch_section_names %}
{% for page in site.pages %}
{% if page.title == pagetitle %}
<li>{{ page.title }}</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment