Unverified Commit d4b7c86e authored by Igor Varyvoda's avatar Igor Varyvoda Committed by GitHub

docs: add Sirv loader for `next/image` (#57102)

Co-authored-by: 's avatarLee Robinson <me@leerob.io>
parent 142e7080
......@@ -48,6 +48,7 @@ Alternatively, you can use the [`loader` prop](/docs/pages/api-reference/compone
- [Imgix](#imgix)
- [Thumbor](#thumbor)
- [Sanity](#sanity)
- [Sirv](#sirv)
- [Supabase](#supabase)
### Akamai
......@@ -172,6 +173,20 @@ export default function sanityLoader({ src, width, quality }) {
}
```
### Sirv
```js
// Docs: https://sirv.com/help/articles/dynamic-imaging/
export default function sirvLoader({ src, width, quality }) {
const url = new URL(`https://example.com${src}`);
const params = url.searchParams;
params.set("format", params.getAll("format").join(",") || "optimal");
params.set("w", params.get("w") || width.toString());
params.set("q", (quality || 85).toString());
return url.href;
}
```
### Supabase
```js
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment