hacks-guide-minimal-mistake.../_includes/documents-collection.html
Michael Rose d6605146ac Add posts, categories, category, tags, tag, and collection layouts
Replace sample pages with hard coded HTML and Liquid in favor of a layout that does all the heavy lifting. Assign the appropriate `layout` via YAML Front Matter and away you go.
2018-03-20 12:45:28 -04:00

19 lines
577 B
HTML

{% assign entries = site[include.collection] %}
{% if include.sort_by == 'title' %}
{% if include.sort_order == 'reverse' %}
{% assign entries = entries | sort: 'title' | reverse %}
{% else %}
{% assign entries = entries | sort: 'title' %}
{% endif %}
{% elsif include.sort_by == 'date' %}
{% if include.sort_order == 'reverse' %}
{% assign entries = entries | sort: 'date' | reverse %}
{% else %}
{% assign entries = entries | sort: 'date' %}
{% endif %}
{% endif %}
{%- for post in entries -%}
{% include archive-single.html %}
{%- endfor -%}