{% extends "base.html" %}
{% import "macros.html" as macros %}

{% block title %}{{ page.title }} · {{ config.title }}{% endblock title %}

{% block content %}
{% include "partials/back-to-section.html" %}
<article>
    <header class="entry-header">
        <h1>{{ page.title }}</h1>

        {% if page.description %}
            <p class="entry-description">{{ page.description }}</p>
        {% endif %}

        {% include "partials/entry-dates.html" %}

        {% if page.taxonomies.themes %}
            <dl class="metadata">
                <dt>Thème</dt>
                <dd>
                    {{ macros::taxonomy_links(terms=page.taxonomies.themes, kind="themes") }}
                </dd>
            </dl>
        {% endif %}
    </header>

    {% set banner = page.extra | get(key="banner", default="") %}
    {% if banner %}
        {% set banner_alt = page.extra | get(key="banner_alt", default="") %}
        {% set banner_credit = page.extra | get(key="banner_credit", default="") %}

        <figure class="article-cover">
            <img
                src="{{ get_url(path=banner) | safe }}"
                alt="{{ banner_alt }}"
            >

            {% if banner_credit %}
                <figcaption>{{ banner_credit }}</figcaption>
            {% endif %}
        </figure>
    {% endif %}

    {{ page.content | safe }}
</article>
{% endblock content %}
