]> git.mxchange.org Git - friendica.git/commitdiff
add lazy loading for images
authorFaris <fariskarim2000@gmail.com>
Mon, 2 Oct 2023 16:23:02 +0000 (12:23 -0400)
committerFaris <fariskarim2000@gmail.com>
Mon, 2 Oct 2023 16:23:02 +0000 (12:23 -0400)
view/templates/content/image.tpl

index 00b1aac100ca38880e39b7160011088c002a3824..81fad073cddea0b8a0f203ef5fd663bdfa164660 100644 (file)
@@ -1,5 +1,5 @@
 {{if $image.preview}}
-<a data-fancybox="{{$image.uri_id}}" href="{{$image.attachment.url}}"><img src="{{$image.preview}}" alt="{{$image.attachment.description}}" title="{{$image.attachment.description}}"></a>
+<a data-fancybox="{{$image.uri_id}}" href="{{$image.attachment.url}}"><img src="{{$image.preview}}" alt="{{$image.attachment.description}}" title="{{$image.attachment.description}}" loading="lazy"></a>
 {{else}}
-<img src="{{$image.src}}" alt="{{$image.attachment.description}}" title="{{$image.attachment.description}}">
+<img src="{{$image.src}}" alt="{{$image.attachment.description}}" title="{{$image.attachment.description}}" loading="lazy">
 {{/if}}