{% extends "page/titled/default.html.twig" %}

{%- block meta_title -%}
    {{- parent()|build_string(category) -}}
{% endblock %}

{% block meta_description %}
    {{- parent()|build_string(category) -}}
{% endblock %}

{% block page_title %}
    {{- parent()|build_string(category) -}}
{% endblock %}

{% block page_subtitle %}
    {% set pageSubTitle = _page.subTitle.value|build_string(category) %}

    {{- parent() -}}
{% endblock %}

{% block body %}
    {% for post in pager %}
        {% if not loop.first %}
            <hr class="col-12">
        {% endif %}

        {{ include('page/post/_post.html.twig', {post: post}) }}
    {% endfor %}

    {% if pager.getPaginationData.pageCount > 1 %}
        <div class="col-12">
            <div class="body">
                <div class="pager align-right">
                    {% block pager %}
                        {{ include('module/_pager.html.twig', {
                            route: _node.routeName,
                            routeParams: {
                                _domain: _domain,
                                category: category.id,
                                slug: category.slug
                            },
                            pages: pager.paginationData.pageCount,
                            currentPage: pager.paginationData.current
                        }) }}
                    {% endblock %}
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}
