{% extends "layouts/base.njk" %}

{% block beforeContent %}
  {{ govukBreadcrumbs({
    classes: "govuk-!-display-none-print",
    items: breadcrumbItems
  }) if showBreadcrumbs }}
{% endblock %}

{% block content %}
  <div class="govuk-grid-row">
    <div class="govuk-grid-column-full">
      {{ appDocumentHeader({
        caption: caption,
        title: title,
        date: date,
        modified: modified,
        author: author,
        authors: authors,
        tags: tags
      }) }}
    </div>

    <div class="govuk-grid-column-two-thirds-from-desktop">
      {{ appMetadata({
        date: date,
        modified: modified,
        author: author,
        authors: authors,
        tags: tags
      }) }}

      {% call appProseScope() %}
        {% if image -%}
          <figure>
            <img src="{{ image.src }}" alt="{{ image.alt }}">
            {% if image.caption -%}
            <figcaption>{{ image.caption | markdown }}</figcaption>
            {% endif -%}
          </figure>
        {%- endif %}

        {{ content }}
      {% endcall %}

      {% if showPagination %}
        {% set previous = collections.navigation | eleventyNavigation(sectionKey or options.homeKey) | getPreviousNavigationItem(page.url) %}
        {% set next = collections.navigation | eleventyNavigation(sectionKey or options.homeKey) | getNextNavigationItem(page.url) %}
        {{ govukPagination({
          previous: {
            labelText: previous.title,
            href: previous.url
          } if previous,
          next: {
            labelText: next.title,
            href: next.url
          } if next
        }) }}
      {% endif %}
    </div>

    {% if aside or related %}
      <div class="govuk-grid-column-one-third-from-desktop">
        {% include "layouts/shared/related.njk" %}
      </div>
    {% endif %}
  </div>
{% endblock %}
