{% extends "partials/page.html.twig" %} {% set collection = page.collection() %} {% block content %} {% if page.content %}
{{ page.content|raw }}
{% endif %}
{# Leading #} {% if page.header.content.leading > 0 %} {% for child in collection | slice(0, page.header.content.leading) %}
{% include 'partials/blog_item.html.twig' with {'blog': page, 'page': child, 'truncate': true, 'show_date': page.header.content.show_date } %}
{% endfor %} {% endif %} {# Column Layout #} {% if page.header.content.columns > 1 %} {% if page.header.content.leading %} {% for row in collection | slice(page.header.content.leading) | batch(page.header.content.columns) %}
{% for child in row %} {% include 'partials/blog_item.html.twig' with {'blog': page, 'page': child, 'truncate': true, 'show_date': page.header.content.show_date} %} {% endfor %}
{% endfor %} {% else %} {% for row in collection | batch(page.header.content.columns) %}
{% for child in row %} {% include 'partials/blog_item.html.twig' with {'blog': page, 'page': child, 'truncate': true, 'show_date': page.header.content.show_date} %} {% endfor %}
{% endfor %} {% endif %} {% else %} {% if page.header.content.leading > 0 %} {% for child in collection | slice(page.header.content.leading) %} {% include 'partials/blog_item.html.twig' with {'blog': page, 'page': child, 'truncate': true, 'show_date': page.header.content.show_date} %} {% endfor %} {% else %} {% for child in collection %} {% include 'partials/blog_item.html.twig' with {'blog': page, 'page': child, 'truncate': true, 'show_date': page.header.content.show_date} %} {% endfor %} {% endif %} {% endif %}
{% if config.plugins.pagination.enabled and collection.params.pagination %} {% include 'partials/pagination.html.twig' with {'base_url': page.url, 'pagination': collection.params.pagination} %} {% endif %} {% endblock %}