{% extends 'partials/base.html.twig' %} {% block body %} {%- set photo = page.header.photo ? page.media[page.header.photo] : null -%} {%- set social = page.header.social ?? {} -%} {%- set per_page = 9 -%} {%- set all = taxonomy.findTaxonomy({'author': [page.slug]}).order('date', 'desc') -%} {%- set articles = [] -%} {% for r in all %}{% if r.template == 'item' and r.published %}{% set articles = articles|merge([r]) %}{% endif %}{% endfor %} {%- set total = articles|length -%} {%- set total_pages = (total / per_page)|round(0, 'ceil') -%} {%- set current = (uri.query('page') ?: 1) + 0 -%} {% if current < 1 %}{% set current = 1 %}{% endif %} {%- set items = articles|slice((current - 1) * per_page, per_page) -%}
{% include 'partials/breadcrumbs.html.twig' %}
{% if photo %}{{ page.title }}{% else %}{% endif %}

{{ page.title }}

{% if page.header.role %}

{{ page.header.role }}

{% endif %} {% if page.header.bio or page.content %}
{{ (page.header.bio ?: page.content)|raw }}
{% endif %} {% if social %} {% endif %}

Artigos de {{ page.title }}

{% if items|length %}
{% for it in items %}{% include 'partials/article-card.html.twig' with {item: it} %}{% endfor %}
{% include 'partials/pagination.html.twig' with {current: current, total_pages: total_pages, base: page.url} %} {% else %}
Este autor ainda não publicou artigos.
{% endif %}
{% endblock %}