Skip to content

Commit

Permalink
feat(webp): encode images in webp
Browse files Browse the repository at this point in the history
  • Loading branch information
obviyus committed Nov 1, 2022
1 parent 1f561b6 commit 3b89bd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ await Promise.all(
const date = await getImageDate(image);
insertSorted(sortedImages, {
original: await getImage({ ...image.default }),
original: await getImage({ ...image.default, format: 'webp' }),
thumbnail: await getImage({
src: image.default.src,
width: 640,
aspectRatio: image.default.width / image.default.height,
quality: 80,
format: 'webp',
}),
date: date,
slug: `image/${await getImageSlug(image.default.src)}`,
Expand Down

0 comments on commit 3b89bd9

Please sign in to comment.