Modify <img srcset> example to be more readable

This commit is contained in:
Joseph Wynn 2014-12-07 13:46:07 +00:00
parent e997361cb5
commit 605eda60c3
1 changed files with 7 additions and 5 deletions

View File

@ -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>`