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.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. <link type="text/html" href="https://mastodon.social/@dav" rel="me" />
  10. {% endblock %}
  11. {% block container %}
  12. <div class="galleries">
  13. {% for gallery in galleries -%}
  14. {% if not gallery.private %}
  15. <div class="gallery-cover">
  16. <a href="{{ gallery.cover_photo.page_url }}">
  17. <picture>
  18. <source
  19. srcset="
  20. {%- for size in sizes %}
  21. {{ gallery.cover_photo.gallery_slug }}/webp/{{ gallery.cover_photo.name }}_{{ size.0 }}x{{ size.1 }}.webp {{ size.0 }}w{% if not loop.last%},{% endif %}
  22. {%- endfor -%}
  23. "
  24. sizes="min((100vw - 2rem), 330px)"
  25. type="image/webp">
  26. <img
  27. src="{{ gallery.cover_photo.gallery_slug }}/jpg/{{ gallery.cover_photo.name }}_{{ sizes.0.0 }}x{{ sizes.0.1 }}.jpg"
  28. width="{{ gallery.cover_photo.width }}" height="{{ gallery.cover_photo.height }}"
  29. srcset="
  30. {%- for size in sizes %}
  31. {{ gallery.cover_photo.gallery_slug }}/jpg/{{ gallery.cover_photo.name }}_{{ size.0 }}x{{ size.1 }}.jpg {{ size.0 }}w{% if not loop.last%},{% endif %}
  32. {%- endfor -%}
  33. "
  34. sizes="min((100vw - 2rem), 330px)"
  35. alt="{{ gallery.cover_photo.alt or 'TODO' }}" loading="lazy" decoding="async">
  36. <figcaption>{{ gallery.name }}</figcaption>
  37. </picture>
  38. </a>
  39. </div>
  40. {% endif %}
  41. {% endfor %}
  42. </div>
  43. {% endblock %}