datat.fi/_includes/documents-collection.html

20 lines
568 B
HTML
Raw Normal View History

{% 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 entry.html %}
{%- endfor -%}