refactor: reduce the amount of image formats and sizes

Use the least amount of image formats and sizes:

- WebP for images
- Avif with JPEG fallback for pictures
This commit is contained in:
Stefan Imhoff
2023-06-12 20:52:25 +02:00
parent 37e3e8260e
commit 65fe960af0
14 changed files with 33 additions and 19 deletions

View File

@@ -26,7 +26,13 @@ const imageClasses =
src.includes('.svg') ? (
<img class={imageClasses} src={src} {...(props as any)} />
) : (
<Img src={src} attributes={{ class: imageClasses }} {...props} />
<Img
attributes={{ class: imageClasses }}
breakpoints={[500, 1000, 1500]}
format="webp"
src={src}
{...props}
/>
)
}
</div>