Sha256: 65fae57c175c5b7aa3b0c108967c063a6629da7fa0a24424c6a9c4081c03fca6

Contents?: true

Size: 1.84 KB

Versions: 33

Compression:

Stored size: 1.84 KB

Contents

{% assign resizedImageTypes = "jpg,jpeg,png" | split: ',' %}
{% assign resized = false %}
{% for imageType in resizedImageTypes %}
    {% if include.path contains imageType %}
        {% assign resized = true %}
    {% endif %}
{% endfor %}
{% if resized %}
{% assign webpImage = include.path | replace: "/assets/images", "/assets/images/webp"| split: "." %}
{% assign webpImage =  webpImage[0] | append: ".webp" %}
{% assign imageType = "image/" | append: include.type %}

{% assign smallImage = include.path | replace: '/assets/images' , '/assets/images/400' %}
{% assign mediumImage = include.path | replace: '/assets/images' , '/assets/images/800' %}
{% assign largeImage = include.path | replace: '/assets/images' , '/assets/images/1400' %}

<picture>
<!--[if IE 9]><video style="display: none;><![endif]-->
<source data-srcset="{{smallImage | replace: '/assets/images', '/assets/images/webp' | replace: include.type, 'webp'}}" media="(max-width: 480px)" type="image/webp" />
<source data-srcset="{{smallImage}}" media="(max-width: 480px)" type="{{imageType}}" />
<source data-srcset="{{mediumImage | replace: '/assets/images', '/assets/images/webp' | replace: include.type, 'webp'}}" media="(max-width: 900px)" type="image/webp" />
<source data-srcset="{{mediumImage}}" media="(max-width: 900px)" type="{{imageType}}" />
<source data-srcset="{{largeImage | replace: '/assets/images', '/assets/images/webp' | replace: include.type, 'webp'}}" media="(max-width: 1400px)" type="image/webp" />
<source data-srcset="{{largeImage}}" media="(max-width: 1400px)" type="{{imageType}}" />
<!--[if IE 9]></video><![endif]-->
<img data-src="{{largeImage}}" class="lazyload" alt="{{include.alt}}" />
</picture>
{% else %}
<img  data-src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" src="{{include.image}}"
 alt="{{include.alt}}" class="lazyload"/>
{% endif %}

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
jumbo-jekyll-theme-5.6.9.4 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.9.3 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.9.2 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.9.1 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.9 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.8 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.7 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.6 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.5 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.4 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.3 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.2 _includes/thumb-image.html
jumbo-jekyll-theme-5.6.0 _includes/thumb-image.html
jumbo-jekyll-theme-5.5.6 _includes/thumb-image.html
jumbo-jekyll-theme-5.5.5 _includes/thumb-image.html
jumbo-jekyll-theme-5.5.4 _includes/thumb-image.html
jumbo-jekyll-theme-5.5.3 _includes/thumb-image.html
jumbo-jekyll-theme-5.5.2 _includes/thumb-image.html
jumbo-jekyll-theme-5.5.1 _includes/thumb-image.html
jumbo-jekyll-theme-5.5.0 _includes/thumb-image.html