Modify <img srcset> example to be more readable
This commit is contained in:
parent
e997361cb5
commit
605eda60c3
12
README.md
12
README.md
|
@ -104,11 +104,13 @@ You will need to create a template in order to use the `responsive_image` tag. B
|
||||||
#### Responsive images with `srcset`
|
#### Responsive images with `srcset`
|
||||||
|
|
||||||
```twig
|
```twig
|
||||||
<img src="/{{ path }}"
|
{% capture srcset %}
|
||||||
srcset="
|
{% for i in resized %}
|
||||||
{% for i in resized %}/{{ i.path }} {{ i.width }}w,{% endfor %}
|
/{{ i.path }} {{ i.width }}w,
|
||||||
/{{ original.path }} {{ original.width }}w
|
{% endfor %}
|
||||||
">
|
{% endcapture %}
|
||||||
|
|
||||||
|
<img src="/{{ path }}" srcset="{{ srcset | strip_newlines }} /{{ original.path }} {{ original.width }}w">
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Responsive images with `<picture>`
|
#### Responsive images with `<picture>`
|
||||||
|
|
Loading…
Reference in New Issue