Quellcode durchsuchen

Use native lazy-loading in images

Danilo Gómez Gómez vor 4 Jahren
Ursprung
Commit
260bd12d97
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      layout/_base.html
  2. 1 1
      layout/work.html

+ 1 - 1
layout/_base.html

@@ -104,7 +104,7 @@
 				<div id="img-prev">{{ 'prev' | svg }}</div>
 				<div class="vbox">
 					<div id="close-modal">{{ 'close' | svg }}</div>
-					<img id="modal-image" alt="no image">
+					<img id="modal-image" loading="lazy" alt="no image">
 				</div>
 				<div id="img-next">{{ 'next' | svg }}</div>
 			</div>

+ 1 - 1
layout/work.html

@@ -10,7 +10,7 @@
 {% block main %}
 {% for image in (sorted(images(path), reverse=True) if sort_images else images(path)) %}
 	<figure class="{{ 'clickable-fig' if expand_dialog else ''}}">
-		<img class="tile" src="{{ (image.main or image.filenames[0]) | static }}" alt="{{ image.category }}: {{ image.name }} ({{ image.year }})">
+		<img class="tile" src="{{ (image.main or image.filenames[0]) | static }}" loading="lazy" alt="{{ image.category }}: {{ image.name }} ({{ image.year }})">
 		<figcaption class="hbox">
 			<div class="caption">
 				<h1>{{ image.name }} / <time>{{ image.year }}</time></h1>