{% extends "base.html" %}

{% load static dsfr_tags wagtailcore_tags wagtailimages_tags i18n %}

{% block title %}
  <title>{{ page.seo_title|default:page.title }} — {{ settings.sites_conformes_content_manager.CmsDsfrConfig.site_title }}</title>
{% endblock title %}

{% if page.search_description %}
  {% block description %}
    <meta name="description" content="{{ page.search_description }}" />
  {% endblock description %}
{% endif %}

{% block social_media %}
  <meta property="og:site_name"
        content="{{ settings.sites_conformes_content_manager.CmsDsfrConfig.site_title }}" />
  <meta property="og:title" content="{{ title }}" />
  <meta property="og:type" content="website" />
  <meta property="og:url" content="{{ request.build_absolute_uri }}" />
  <meta property="og:description" content="{{ search_description }}" />
  <meta property="og:locale" content="{{ LANGUAGE_CODE }}" />

  <meta name="twitter:title" content="{{ title }}" />
  <meta name="twitter:description" content="{{ search_description }}" />
{% endblock social_media %}

{% block content %}
  <div class="fr-container fr-my-6w">
    {% include "sites_conformes_content_manager/blocks/breadcrumbs.html" %}
    {% if page.show_title %}
      <h1>
        {{ page.title }}
        {% if extra_title %}: {{ extra_title }}{% endif %}
      </h1>
    {% endif %}

    {% include "sites_conformes_content_manager/blocks/messages.html" %}

    <ul>
      {% for category in categories|dictsort:"cat_name" %}
        <li>
          <a href="{% pageurl page %}?category={{ category.cat_slug }}"><strong>{{ category.cat_name }}</strong> ({{ category.cat_count }})</a>
        </li>
      {% endfor %}
    </ul>
  </div>

{% endblock content %}
