{% 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(100, 200, 300, 400, 600).sizes('50vw, 30vw') %}

{% 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>

        <img class="lazy" data-src="{{ services_image.url() }}" data-srcset="{{ services_image.srcset() }}">

      </a>
    </div>
  </div>
 {% else %}

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

{% endif %}
