forked from rho_n/hpr_generator
Added lazy loading attribute to images in show notes.
This commit is contained in:
parent
860ce671f8
commit
610e91ea9f
@ -5,6 +5,24 @@
|
|||||||
<!--% PROCESS 'shared-call_for_shows.tpl.html' %-->
|
<!--% PROCESS 'shared-call_for_shows.tpl.html' %-->
|
||||||
<!--% INCLUDE 'content-index-announcement.tpl.html' %-->
|
<!--% INCLUDE 'content-index-announcement.tpl.html' %-->
|
||||||
<!--% PROCESS "queries-index-${constants.database}.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>
|
<hr>
|
||||||
<article>
|
<article>
|
||||||
<header>
|
<header>
|
||||||
@ -50,7 +68,7 @@
|
|||||||
<!--% display_comments_tally(latest_episodes.id, latest_episodes.eps_tally) %--></small>
|
<!--% display_comments_tally(latest_episodes.id, latest_episodes.eps_tally) %--></small>
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
<!--% latest_episodes.notes %-->
|
<!--% tidy_notes(latest_episodes.notes) %-->
|
||||||
<footer>
|
<footer>
|
||||||
<!--% show_transcript(latest_episodes, "hpr", baseurl, media_baseurl) %-->
|
<!--% show_transcript(latest_episodes, "hpr", baseurl, media_baseurl) %-->
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user