feat: responsive images for investigation template

Add srcsets in config:
- cover-hero: 940px fixe ≥1000px, 90vw en dessous
- body-full: 100vw (1 colonne)
- body-half: 50vw ≥768px, 90vw en dessous (2 colonnes)

Apply in templates/snippets:
- Cover hero → snippet picture + cover-hero
- Body 1-col images → snippet picture + body-full
- Body 2-col images → snippet picture + body-half
- gallery.php → snippet picture (sizes/srcset paramétrables)
- beforeafter.php → srcset/sizes sur <img> (pas de <picture> pour ne pas
  casser le JS du slider)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-27 13:51:48 +01:00
parent 7bdc58a346
commit df31382a97
4 changed files with 72 additions and 8 deletions

View file

@ -32,6 +32,31 @@ return [
'1000w' => ['width' => 1000, 'format' => 'webp'],
'1456w' => ['width' => 1456, 'format' => 'webp'],
],
// Hero cover investigation : 940px fixe ≥1000px, 90vw en dessous
'cover-hero' => [680, 940, 1200, 1880],
'cover-hero-webp' => [
'680w' => ['width' => 680, 'format' => 'webp'],
'940w' => ['width' => 940, 'format' => 'webp'],
'1200w' => ['width' => 1200, 'format' => 'webp'],
'1880w' => ['width' => 1880, 'format' => 'webp'],
],
// Body 1 colonne : 100vw
'body-full' => [750, 1000, 1440, 1880],
'body-full-webp' => [
'750w' => ['width' => 750, 'format' => 'webp'],
'1000w' => ['width' => 1000, 'format' => 'webp'],
'1440w' => ['width' => 1440, 'format' => 'webp'],
'1880w' => ['width' => 1880, 'format' => 'webp'],
],
// Body 2 colonnes : 50vw ≥768px, 90vw en dessous
'body-half' => [680, 720, 1000, 1380, 1440],
'body-half-webp' => [
'680w' => ['width' => 680, 'format' => 'webp'],
'720w' => ['width' => 720, 'format' => 'webp'],
'1000w' => ['width' => 1000, 'format' => 'webp'],
'1380w' => ['width' => 1380, 'format' => 'webp'],
'1440w' => ['width' => 1440, 'format' => 'webp'],
],
],
],
'panel' => [