Fixed: lazyload slider
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2021-10-31 01:33:22 +02:00
parent b6819225ed
commit 3b8cffec2a
1 changed files with 6 additions and 1 deletions

View File

@ -4,7 +4,12 @@
{% for post in __SELF__.posts %}
<div class="px-3">
<a href="{{post.href}}" class="flex flex-col h-full box shadow-lg hover:shadow-2xl rounded-lg overflow-hidden" target="_BLANK">
{% if post.featuredImage %} <img {{ post.featuredImage | resize('box', 'calc(100vw - 1.5rem)|640:calc(50vw - 1.5rem)|1024:calc(33vw - 1.5rem)|1152:360px', {'lazy': true}) }} class="object-cover w-full h-48"> {% endif %}
{% if post.featuredImage %}
<script type="text/html" data-lazy data-src="img">
<img {{ post.featuredImage | resize('box', 'calc(100vw - 1.5rem)|640:calc(50vw - 1.5rem)|1024:calc(33vw - 1.5rem)|1152:360px') }} class="object-cover w-full h-48">
</script>
<div data-dest="img"></div>
{% endif %}
<div class="flex items-end justify-between px-6 py-3 bg-gray-100">
{% if __SELF__.logo %} <img data-src="{{__SELF__.logo|media}}" class="w-8"> {% endif %}
<div class="text-xs text-gray-500">{{post.created_at | human}}</div>