Made lazy loading optional

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2018-01-02 17:18:44 +01:00
parent 26207408c0
commit a84494e71e
2 changed files with 8 additions and 1 deletions

1
_data/lazy-loading.yml Normal file
View File

@ -0,0 +1 @@
enabled: false

View File

@ -1,3 +1,4 @@
{% if site.data.lazy-loading.enabled %}
<img alt="{{ include.alt }}"
src="/assets/images/blank.png"
data-echo="{% if site.data.cdn.use and jekyll.environment == 'production' %}{{ site.data.cdn.url }}{% else %}{{ site.baseurl }}{% endif %}{{ include.link }}"
@ -7,4 +8,9 @@
<img alt="{{ include.alt }}"
src="{% if site.data.cdn.use and jekyll.environment == 'production' %}{{ site.data.cdn.url }}{% else %}{{ site.baseurl }}{% endif %}{{ include.link }}"
class="img-fluid" />
</noscript>
</noscript>
{% else %}
<img alt="{{ include.alt }}"
src="{% if site.data.cdn.use and jekyll.environment == 'production' %}{{ site.data.cdn.url }}{% else %}{{ site.baseurl }}{% endif %}{{ include.link }}"
class="img-fluid" />
{% endif %}