{% extends 'partials/base.html.twig' %}

{% set bodyclass = "projet" %}

{% set images = page.media.images[2:] %}
{% set images = images|merge(page.media.files) %}

{% block content %}
  <section class="projet">

    {% if page.taxonomy.tag %}
    {{ dump(catlist) }}
      <nav class="categories">
        <ul>
          {% for tag in page.taxonomy.tag %}
            <li>
              <a
                class="tag-{{ catlist[(tag|e('url'))] }}"
                href="/#{{ tag|replace({'|': "-", " " : ""}) }}">
                  <span>{{ tag }}</span>
              </a>
            </li>
          {% endfor %}
        </ul>
      </nav>
    {% endif %}

    <h1>{{page.title}}<span class="date">{{page.date|date("Y")}}</span></h1>
    <h2>{{ page.header.subtitle}}</h2>

    {{ page.content }}

    <div id="images" class="">
      {{ dump(images) }}
      {% for image in images %}
        {{ image.lightbox().resize(600).html(image.meta.title) }}
      {% endfor %}
    </div>
  </section>

  <nav class="categories">
    {% include 'partials/tagslist.html.twig' with {'base_url':"/", 'taxonomy':'tag', 'display':'inline'} %}
  </nav>

{% endblock %}
