-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make WidthStep and MaxWidth overridable via helper & service #55
Comments
Should also add parameters to the tag helper to pass these through for specific instances |
Thinking about the tag helper and the many options we now have, for v5 we are going to introduce "Config Presets" |
Nice! So we can do "small image with 3 steps" and "large photo with 7 steps" like the crop aliases? |
@lars-erik yes exactly, something like: "TagHelper": {
"Presets": [
{
"Alias": "SpecialImportant",
"PictureSources": [
{
"Extension": "webp",
"Quality": 100,
"LQIPQuality":20
},
{
"Extension": "avif",
"Quality": 100,
"LQIPQuality":10
},
{
"Extension": "jpg",
"Quality": 100
"LQIPQuality":20
}
],
"WidthStep": 60,
"MaxWdith": 3000,
"UseCropAsSrc": true,
"ImageDimensions": true
},
{
"Alias": "NormalImage",
"PictureSources": [
{
"Extension": "webp",
"Quality": 70
"LQIPQuality":20
},
{
"Extension": "avif",
"Quality": 60
"LQIPQuality":10
},
{
"Extension": "jpg",
"Quality": 70
"LQIPQuality":20
}
],
"WidthStep": 160,
"MaxWdith": 3000,
"UseCropAsSrc": true,
"ImageDimensions": true
}
]
} What do you think? |
Awesome! How about quality for placeholder image that's there before lazysizes kicks in? On a sidenote, I had an interesting dicussion with @bjarnef about how to make "the" image above the fold not lazy loaded. (think block grid) |
I've added LQIPQuality to the above config concept. On the question of not lazy loading the first image, we think we can generate a sizes attribute with a new method, something like @Url.GenerateSizesForEagerLoad() but you would still need to figure out in your own logic which image should use this method instead of lazy load, interesting in block grids etc..... |
Hi @Jeavon |
It'd be nice to be able to specify a "slimmer" srcset in specific use cases.
If I understand the code correctly, there's only one
SlimsyOptions
with settings for WidthStep and MaxWidth, and you'd have to create the service manually to do it differently.Maybe as simple as making those two optional parameters all the way. I think the remaining config options are already overridable?
The text was updated successfully, but these errors were encountered: