Skip to content

Commit

Permalink
Merge pull request #34 from buildheadless/image
Browse files Browse the repository at this point in the history
feat:(theme) SanityImage is now returned as webp
  • Loading branch information
thomasKn authored Dec 1, 2023
2 parents bd29eff + 754bd48 commit 8e51946
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions templates/hydrogen-theme/app/components/sanity/SanityImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export function SanityImage(props: {
const urlBuilder = imageUrlBuilder({
projectId: env?.SANITY_STUDIO_PROJECT_ID!,
dataset: env?.SANITY_STUDIO_DATASET!,
}).image({
_ref: data._ref,
crop: data.crop,
hotspot: data.hotspot,
});
})
.image({
_ref: data._ref,
crop: data.crop,
hotspot: data.hotspot,
})
.auto('format');

const urlDefault = urlBuilder.url();
// Values used for srcset attribute of image tag (in pixels)
Expand Down

0 comments on commit 8e51946

Please sign in to comment.