Merge pull request 'Add lazy loading to host image' (#88) from I83_Lazy_load_host_images into main

Reviewed-on: rho_n/hpr_generator#88
This commit is contained in:
Roan Horning 2023-03-04 22:00:52 +00:00
commit 0f4fdc2d46
2 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,5 @@
<!--% PROCESS 'shared-avatar.tpl.html' %-->
<!--% PROCESS 'host-thumbnail.tpl.html' %-->
<!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% PROCESS 'shared-listen-now.tpl.html' %-->
<!--% PROCESS 'shared-show-transcript.tpl.html' %-->
@ -35,6 +36,7 @@
<hr>
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
<h1>Latest Shows</h1>
<!--% host_cnt = 0 %-->
<!--% FOREACH latest_episodes IN DBI.query(query_latest_episodes)
%-->
<hr>
@ -43,7 +45,9 @@
<h1><a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(latest_episodes.id) %-->/index.html">hpr<!--% latest_episodes.id %--> :: <!--% latest_episodes.title %--></a></h1>
<h3><!--% latest_episodes.summary%--></h3>
<p class="meta"$><!--% IF get_avatar(latest_episodes.hostid) != 'hpr_logo.png' %-->
<img src="<!--% absolute_path(baseurl) %-->images/<!--% get_avatar(latest_episodes.hostid) %-->" height="80" width="80" alt="" /></a><!--% END %-->
<a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(latest_episodes.hostid) %-->.html">
<!--% host_thumb(get_avatar(latest_episodes.hostid), latest_episodes.host, host_cnt) %-->
</a><!--% END %-->
<br>Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(latest_episodes.hostid) %-->.html"><!--% latest_episodes.host %--></a> on <!--% latest_episodes.date %--> is flagged as <!--% display_explicit(latest_episodes.explicit) %--> and released under a <!--% latest_episodes.license %--> license. <br>
<!--% display_tags(latest_episodes.tags) %--><br>
<small><!--% display_listen_in(latest_episodes.id) %--> <!--% show_series(latest_episodes.series, latest_episodes.seriesid) %--> |
@ -57,6 +61,7 @@
<!--% listen_now(latest_episodes, "hpr", baseurl, media_baseurl) %-->
</footer>
</article>
<!--% host_cnt = host_cnt + 1 %-->
<!--% END %-->
<article>
<header>

View File

@ -0,0 +1,3 @@
<!--% MACRO host_thumb(avatar, host_name, host_cnt) BLOCK %-->
<img src="<!--% absolute_path(baseurl) %-->images/<!--% avatar %-->" height="80" width="80" alt="Thumbnail of <!--% host_name | html %-->" <!--% IF host_cnt %-->loading="lazy"<!--% END %--> />
<!--% END %-->