{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'-', 'é':'e', ',':'',':':'','.':'','(':'',')':'','?':'', "’": '','ê':'e' }) }}{% endmacro %}

{% import _self as macro %}

{% set image = page.media.images|first %}
{# {% set services_image = page.media.images|first.derivatives(320,1600,300).sizes('(max-width:26em) 100vw, 50vw') %} #}

{% set services_image = page.media.images|first%}

{% if image %}
<!-- card projet -->
  <div class="card">
    <div class='loader'></div>

    <div id="{{ page.folder }}" class="card-image">
      <a href="{{ page.url }}">

        <div class="card-header">
          {% if page.header.title %}
          {% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
          {% endif %}
          {% if page.header.taxonomy.tag %}
          {% include 'partials/blog/taxonomy.html.twig' %}
          {% endif %}

          {% if page.header.date %}
          {% include 'partials/blog/date.html.twig' %}
          {% endif %}
        </div>

        {{ services_image.sizes('(max-width:26em) 100vw').html(page.header.title, 'images projets', '')}}

      </a>
    </div>

  </div>

 {% else %}

   {% include 'partials/blog/title.html.twig' with {title_level: 'p'} %}

{% endif %}
