html.mk

static html creation framework using make(1) and cpp(1)
Log | Files | Refs | README | LICENSE

commit f2fdfe9a89152e9e9a81b3b6faf56bbe63d4006d
parent fe2b4b41c73d1c7993e28b1a97bd06c8a24547df
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Tue, 20 Jul 2021 19:56:43 +0000

mk: use lazy loading attrs on img

Diffstat:
Mmk/html.mk | 4++--
Mt/img_html.t | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mk/html.mk b/mk/html.mk @@ -81,12 +81,12 @@ depend: ${SRCS:.in=.depend} _SUBDIRUSE @# Create HTML fragment that uses the thumbnail as a base image @# that is a link to the full size (copied) image, like this: @# - @# <a href="pic_cp.jpg"><img src="pic_thumb.jpg" + @# <a href="pic_cp.jpg"><img loading='lazy' src="pic_thumb.jpg" @# @# NOTE: The <img> tag is not closed! You must close it, maybe with: @# alt="description of image for blind people" /></a> @# - echo "\t<a href='_img/${<F}'><img src='_img/${<F:R}_thumb.${<F:E}' " > $@ + echo "\t<a href='_img/${<F}'><img loading='lazy' src='_img/${<F:R}_thumb.${<F:E}' " > $@ # # Generate `*_html' html fragments that link to videos using <video> tag. diff --git a/t/img_html.t b/t/img_html.t @@ -61,7 +61,7 @@ for my $sfx (@sfxs) { file_exists_ok( catfile( $cmd->workdir, $thumb_file ) ); my $html_good = <<EOF; - <a href='$cp_file'><img src='$thumb_file' + <a href='$cp_file'><img loading='lazy' src='$thumb_file' EOF my $html_file = catfile( $cmd->workdir, "pic_${sfx}.img_html" );