VallejosGroup / VallejosGroup.github.io

Jekyll source code for the Vallejos Group Website
https://vallejosgroup.github.io
MIT License
1 stars 2 forks source link

Allow fall back to jpg/png for webp images #10

Closed nathansam closed 2 years ago

nathansam commented 2 years ago

The site currently uses webp images wherever possible without a png/jpg fallback. Legacy browsers (<4% of global traffic) do not support webp images. Good practice would be to wrap all images in <picture> and provide jpg/png fall backs.

Example:

<picture>
  <source srcset="image.webp" type="image/webp">
  <source srcset="image.jpg" type="image/jpeg"> 
  <img src="image.jpg" alt="Alt Text!">
</picture>