Use imgix auto=format for automatic webp conversion

This commit is contained in:
Eric Jinks 2018-05-29 15:12:47 +10:00
parent 1c09e8b839
commit 3eea3caf6b
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
## 0.2.8 - 2018-05-29
* Use imgix auto=format for automatic webp conversion
## 0.2.7 - 2018-05-25
* Update slugify() util function to support plural initialisms

View file

@ -4,7 +4,7 @@ const resizedDir = '/images/uploads/resized/'
const imgixUrl = null // imgix web folder domain e.g. https://example.imgix.net (no trailing slash)
const getImgixUrl = ({ path, size }) =>
`${imgixUrl}${encodeURI(path)}?w=${size}&fit=max&auto=compress`
`${imgixUrl}${encodeURI(path)}?w=${size}&fit=max&auto=compress,format`
const parseFilename = filename => {
const parts = filename.match(/(.+)\.([\w]+)$/)