blog-list-item.html.twig 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'-', 'é':'e', ',':'',':':'','.':'','(':'',')':'','?':'', "’": '','ê':'e' }) }}{% endmacro %}
  2. {% import _self as macro %}
  3. {% set image = page.media.images|first %}
  4. {# {% set services_image = page.media.images|first.derivatives(320,1600,300).sizes('(max-width:26em) 100vw, 50vw') %} #}
  5. {% set services_image = page.media.images|first%}
  6. {% if image %}
  7. <!-- card projet -->
  8. <div class="card">
  9. <div class='loader'></div>
  10. <div id="{{ page.folder }}" class="card-image">
  11. <a href="{{ page.url }}">
  12. <div class="card-header">
  13. {% if page.header.title %}
  14. {% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
  15. {% endif %}
  16. {% if page.header.taxonomy.tag %}
  17. {% include 'partials/blog/taxonomy.html.twig' %}
  18. {% endif %}
  19. {% if page.header.date %}
  20. {% include 'partials/blog/date.html.twig' %}
  21. {% endif %}
  22. </div>
  23. {{ services_image.sizes('(max-width:26em) 100vw').html(page.header.title, 'images projets', '')}}
  24. </a>
  25. </div>
  26. </div>
  27. {% else %}
  28. {% if content == true %}
  29. {{content}}
  30. {% else %}
  31. {% include 'partials/blog/title.html.twig' with {title_level: 'p'} %}
  32. {% endif %}
  33. {% endif %}