File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,13 @@ def srcset(*args, **kwargs):
102
102
The first arg must be an ImageField or subclass or a path to an image discoverable by static files.
103
103
104
104
args can provide image sizes in vw for each breakpoint, if not provided 100vw is assumed. These are integers
105
- which are used to calculate generated image sizes. They must be in vw. Sorry no calc() etc allowed.
105
+ which are used to calculate generated image sizes. They must be in vw. Sorry no calc() etc. allowed. Don't try
106
+ too hard here! Close is good enough.
106
107
107
- kwargs can be used to provide this and breakpoints to use
108
+ kwargs can be used to provide this and breakpoints to use.
108
109
109
- A kwarg with the key format can be used to set the output format for generated images
110
-
111
- If the first arg is a key from LAZY_SRCSET_BREAKPOINTS this will be used otherwise the default will be used.
110
+ If the second arg is a key from ``settings.LAZY_SRCSET`` this will be used otherwise the default config will be
111
+ used.
112
112
113
113
Example usage (where image is a file-like e.g. ImageField or a string representing a path to a static file):
114
114
@@ -124,9 +124,11 @@ def srcset(*args, **kwargs):
124
124
125
125
{% srcset image "custom_breakpoints" 25 50 quality=50 %}
126
126
127
+ {% srcset image "custom_breakpoints" 25 50 max_width=1920 quality=50 %}
128
+
127
129
{% srcset image 1920=25 1024=50 %}
128
130
129
- {% srcset image 1920=25 1024=50 max_width=2560 quality=50 %}
131
+ {% srcset image 1920=25 1024=50 max_width=1920 quality=50 %}
130
132
131
133
"""
132
134
args = list (args )
You can’t perform that action at this time.
0 commit comments