Added lazy loading attribute to images in show notes.

This commit is contained in:
Gordon Stanton 2023-03-19 22:51:21 +11:00
parent 860ce671f8
commit 610e91ea9f
1 changed files with 19 additions and 1 deletions

View File

@ -5,6 +5,24 @@
<!--% PROCESS 'shared-call_for_shows.tpl.html' %-->
<!--% INCLUDE 'content-index-announcement.tpl.html' %-->
<!--% PROCESS "queries-index-${constants.database}.tpl.html" %-->
<!--% MACRO tidy_notes(all_lines) BLOCK %-->
<!--% lines = all_lines %-->
<!--% after_html = all_lines %-->
<!--% img_re = '(?six)^(.*?)\<img ([^\>]+\>)(.+)$' %-->
<!--% lazy_re = '(?i)loading="lazy"' %-->
<!--% WHILE (matches = lines.match(img_re)) %-->
<!--% img_tag = matches.1 %-->
<!--% after_html = matches.2 %-->
<!--% matches.0 %-->
<!--% IF (img_tag.search(lazy_re)) %-->
<img <!--% img_tag %-->
<!--% ELSE %-->
<img loading="lazy" <!--% img_tag %-->
<!--% END %-->
<!--% lines = after_html %-->
<!--% END %-->
<!--% after_html %-->
<!--% END %-->
<hr>
<article>
<header>
@ -50,7 +68,7 @@
<!--% display_comments_tally(latest_episodes.id, latest_episodes.eps_tally) %--></small>
</p>
</header>
<!--% latest_episodes.notes %-->
<!--% tidy_notes(latest_episodes.notes) %-->
<footer>
<!--% show_transcript(latest_episodes, "hpr", baseurl, media_baseurl) %-->