feat: responsive images for investigation cover cards

- Add `cover-card` and `cover-card-webp` srcsets in config
  Widths [465, 728, 930, 1000, 1456] couvrent 1x et 2x (retina)
  pour les 3 breakpoints : ≥1000px fixe 465px, 728–1000px 50vw, <728px 100vw
- Refactor snippet picture.php : accepte $sizes (string complète),
  $srcsetName (srcset nommé), $alt (override), fallback webp automatique
- Update investigations.php : remplace <img> nu par snippet picture
  avec sizes et srcsetName adaptés

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-27 11:44:26 +01:00
parent 8d808a87fe
commit ca17be69be
3 changed files with 56 additions and 26 deletions

View file

@ -42,7 +42,13 @@
<?php if ($cover): ?>
<figure>
<img src="<?= $cover->url() ?>" alt="<?= $investigation->title()->esc() ?>">
<?php snippet('picture', [
'file' => $cover,
'alt' => $investigation->title()->value(),
'sizes' => '(min-width: 1000px) 465px, (min-width: 728px) 50vw, 100vw',
'srcsetName' => 'cover-card',
'lazy' => true,
]) ?>
</figure>
<?php endif ?>