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
{% comment %} | |
items is a collection, though I think it coule be any content type | |
{% endcomment %} | |
{% comment %} Create the group. {% endcomment %} | |
{% assign items_grouped = site.items | group_by: 'category' | sort: 'name' | reverse %} | |
{% comment %} | |
The above returns, for example, which is why we sort by 'name' | |
{"name"=>"category1_value", "items"=>[#, #, #, #, #]}{"name"=>"category2_value", "items"=>[#, #, #, #]} | |
{% endcomment %} |