Skip to content

Instantly share code, notes, and snippets.

@carlynorama
Last active January 9, 2018 20:10
Show Gist options
  • Select an option

  • Save carlynorama/e63a9d46a8f8e6ba71e5cc68445f0613 to your computer and use it in GitHub Desktop.

Select an option

Save carlynorama/e63a9d46a8f8e6ba71e5cc68445f0613 to your computer and use it in GitHub Desktop.
liquid template for pulling out the list of collections with jekyll. Alphabetical sort order only as of late 2017
<--! for use with data YAML file to force order -->
{% for item in site.data.collection_nav.nav %}
<a class="page-link" href="{{ site.baseurl }}/{{ item.url }}" alt="{{ item.title }}">{{ item.title }}</a></li>
{% endfor %}
<--! stand alone, alphabetical order -->
{% for collection in site.collections %}
{% unless collection.label == 'posts' %}
<a class="page-link" href="{{ site.baseurl }}/{{ collection.label | remove: "_" }}">{{ collection.title }}</a>
{% endunless %}
{% endfor %}
#Lives in _data file of jekyll site
nav_title: Full Sweep
nav:
- title: Start Here
url: start
- title: Sweep
url: sweep
- title: Learn
url: learn
- title: Engage
url: engage
- title: Relax
url: relax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment