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

{% import _self as macro %}

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

{% if image %}
<!-- card projet -->
  <div class="card">
    <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="{{image.url}}" alt="Projet">
      </a>
    </div>
  </div>
 {% else %}
 <!-- card commanditaire -->
 <div class="card">
   <div id="{{ page.folder }}" class="card-image">
     <!-- <a href="{{ page.url }}"> -->
       <div class="card-title">
         {% if page.header.title %}
          {% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
         {% endif %}
       </div>
     <!-- </a> -->
   </div>
 </div>
{% endif %}
