Created
August 13, 2014 14:21
-
-
Save pootsbook/2e3a097e563c4a9fc970 to your computer and use it in GitHub Desktop.
Sorting custom collections in Jekyll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two files, default sort order is alphabetical ascending on file name. | |
# _config.yml | |
collections: | |
albums: | |
output: true | |
# _albums/audio_video_disco.md | |
--- | |
title: Audio, Video, Disco | |
sortable: 2 | |
--- | |
# _albums/cross.md | |
--- | |
title: Cross | |
sortable: 1 | |
--- | |
# index.md | |
--- | |
--- | |
<ul> | |
{% assign posts = site.albums | sort: "sortable" %} | |
{% for post in posts %} | |
<li>{{post.title}}</li> | |
{% endfor %} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment