This is a gentle fork from https://framagit.org/marienfressinaud/photos.marienfressinaud.fr with a responsive and optimized mindset. https://media.larlet.fr/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html.j2 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {% extends "base.html.j2" %}
  2. {% block title %}Photos & vidéos{% endblock %}
  3. {% block extra_head %}
  4. <!-- CanIHazMoreComplexityPlease? https://htmlhead.dev/ -->
  5. <meta
  6. name="twitter:image" property="og:image" itemprop="image"
  7. content="https://media.larlet.fr/2021--paysages/jpg/15_660x440.jpg"
  8. >
  9. {% endblock %}
  10. {% block container %}
  11. <div class="galleries">
  12. {% for gallery in galleries -%}
  13. {% if not gallery.private %}
  14. <div class="gallery-cover">
  15. <a href="{{ gallery.cover_photo.page_url }}">
  16. <picture>
  17. <source
  18. srcset="
  19. {%- for size in sizes %}
  20. {{ gallery.cover_photo.gallery_slug }}/webp/{{ gallery.cover_photo.name }}_{{ size.0 }}x{{ size.1 }}.webp {{ size.0 }}w{% if not loop.last%},{% endif %}
  21. {%- endfor -%}
  22. "
  23. sizes="min((100vw - 2rem), 330px)"
  24. type="image/webp">
  25. <img
  26. src="{{ gallery.cover_photo.gallery_slug }}/jpg/{{ gallery.cover_photo.name }}_{{ sizes.0.0 }}x{{ sizes.0.1 }}.jpg"
  27. width="{{ gallery.cover_photo.width }}" height="{{ gallery.cover_photo.height }}"
  28. srcset="
  29. {%- for size in sizes %}
  30. {{ gallery.cover_photo.gallery_slug }}/jpg/{{ gallery.cover_photo.name }}_{{ size.0 }}x{{ size.1 }}.jpg {{ size.0 }}w{% if not loop.last%},{% endif %}
  31. {%- endfor -%}
  32. "
  33. sizes="min((100vw - 2rem), 330px)"
  34. alt="TODO" loading="lazy" decoding="async">
  35. <figcaption>{{ gallery.name }}</figcaption>
  36. </picture>
  37. </a>
  38. </div>
  39. {% endif %}
  40. {% endfor %}
  41. </div>
  42. {% endblock %}