-
Notifications
You must be signed in to change notification settings - Fork 305
Open
Description
Hello!
I'm trying to using Nuxt Image with Strapi provider but sizes doesn't work as excepted.
nuxt.configs.js
//...
image: {
strapi: {
baseURL: "http://localhost:1337/uploads",
},
}Because when I use this code:
<nuxt-img
provider="strapi"
loading="lazy"
:src="`${data.file.url}`"
sizes="sm:100vw md:100vw lg:100vw"
/>the output is:
<img
src="http://localhost:1337/uploads/20190131_170142_8085401332.jpg" loading="lazy"
sizes="(max-width: 640px) 100vw, (max-width: 768px) 100vw, (max-width: 1024px) 100vw"
srcset="http://localhost:1337/uploads/20190131_170142_8085401332.jpg 640w,
http://localhost:1337/uploads/20190131_170142_8085401332.jpg 768w,
http://localhost:1337/uploads/20190131_170142_8085401332.jpg 1024w"
/>As you can see, every srcset value has the same url...!
And here is the file data coming from Strapi:
{
"url": "/20190131_170142_8085401332.jpg",
"height": 1440,
"width": 1440,
"formats": {
"thumbnail": {
"url": "/thumbnail_20190131_170142_8085401332.jpg"
},
"medium": {
"url": "/medium_20190131_170142_8085401332.jpg"
},
"small": {
"url": "/small_20190131_170142_8085401332.jpg"
},
"large": {
"url": "/large_20190131_170142_8085401332.jpg"
}
}
}So the excepted output should be:
<img
src="http://localhost:1337/uploads/20190131_170142_8085401332.jpg" loading="lazy"
sizes="(max-width: 640px) 100vw, (max-width: 768px) 100vw, (max-width: 1024px) 100vw"
srcset="http://localhost:1337/uploads/small_20190131_170142_8085401332.jpg 640w,
http://localhost:1337/uploads/medium_20190131_170142_8085401332.jpg 768w,
http://localhost:1337/uploads/large_20190131_170142_8085401332.jpg 1024w"
/>But when I look into the Strapi Provider: (https://github.com/nuxt/image/blob/v1/src/runtime/providers/strapi.ts), I can't see anything about these formats...
So how can I put these small, medium and large urls into srcset?
Am I missing something, or is it just not implemented?
Version
"@nuxt/image-edge": "^1.0.0-27769790.4b27db3",
"nuxt": "3.0.0-rc.11"
Thanks!
alexMugenjiblett1000, graphicfox, aufdenpunkt, Gr33nW33n, leeevin97 and 3 more
Metadata
Metadata
Assignees
Labels
No labels