forked from rho_n/hpr_generator
Merge pull request 'Added lazy loading attribute to images in show notes.' (#100) from I99_Lazy_load_notes_images into main
Reviewed-on: rho_n/hpr_generator#100
This commit is contained in:
commit
0e9ad6ba65
@ -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) %-->
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user