Moved host thumbnail image tag to separate template file.

Added loading="lazy" to image tag.
Changed alt text to show host username.
This commit is contained in:
Gordon Stanton 2023-03-05 02:07:03 +11:00
parent b4e4187902
commit c744bdf175
2 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,5 @@
<!--% PROCESS 'shared-avatar.tpl.html' %--> <!--% PROCESS 'shared-avatar.tpl.html' %-->
<!--% PROCESS 'host-thumbnail.tpl.html' %-->
<!--% PROCESS 'shared-utils.tpl.html' %--> <!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% PROCESS 'shared-listen-now.tpl.html' %--> <!--% PROCESS 'shared-listen-now.tpl.html' %-->
<!--% PROCESS 'shared-show-transcript.tpl.html' %--> <!--% PROCESS 'shared-show-transcript.tpl.html' %-->
@ -35,6 +36,7 @@
<hr> <hr>
<!--% PROCESS 'shared-episode-summary.tpl.html' %--> <!--% PROCESS 'shared-episode-summary.tpl.html' %-->
<h1>Latest Shows</h1> <h1>Latest Shows</h1>
<!--% host_cnt = 0 %-->
<!--% FOREACH latest_episodes IN DBI.query(query_latest_episodes) <!--% FOREACH latest_episodes IN DBI.query(query_latest_episodes)
%--> %-->
<hr> <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> <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> <h3><!--% latest_episodes.summary%--></h3>
<p class="meta"$><!--% IF get_avatar(latest_episodes.hostid) != 'hpr_logo.png' %--> <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> <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> <!--% display_tags(latest_episodes.tags) %--><br>
<small><!--% display_listen_in(latest_episodes.id) %--> <!--% show_series(latest_episodes.series, latest_episodes.seriesid) %--> | <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) %--> <!--% listen_now(latest_episodes, "hpr", baseurl, media_baseurl) %-->
</footer> </footer>
</article> </article>
<!--% host_cnt = host_cnt + 1 %-->
<!--% END %--> <!--% END %-->
<article> <article>
<header> <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 %-->