Refactor templates to use media_path MACRO

This commit is contained in:
Roan Horning 2022-10-01 13:42:46 -04:00
parent d556e28e2d
commit 1d4e6e15b7
Signed by: rho_n
GPG Key ID: 234AEF20B72D5769
5 changed files with 19 additions and 15 deletions

View File

@ -75,7 +75,7 @@ Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pa
</header> </header>
<div><!--% episode.notes %--></div> <div><!--% episode.notes %--></div>
<footer> <footer>
<!--% listen_now(episode, "hpr", baseurl, media_hostname) %--> <!--% listen_now(episode, "hpr", baseurl, media_baseurl) %-->
<p> <p>
<!--% episode_navigation %--> <!--% episode_navigation %-->
</p> </p>

View File

@ -84,7 +84,7 @@
</header> </header>
<!--% latest_episodes.notes %--> <!--% latest_episodes.notes %-->
<footer> <footer>
<!--% listen_now(latest_episodes, "hpr", baseurl, media_hostname) %--> <!--% listen_now(latest_episodes, "hpr", baseurl, media_baseurl) %-->
</footer> </footer>
</article> </article>
<!--% END %--> <!--% END %-->

View File

@ -58,14 +58,14 @@
<img src="<!--% absolute_path(baseurl) %-->images/<!--% get_avatar(episode.hostid) %-->" height="80" width="80" alt="" /></a><br><!--% END %--> <img src="<!--% absolute_path(baseurl) %-->images/<!--% get_avatar(episode.hostid) %-->" height="80" width="80" alt="" /></a><br><!--% END %-->
Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(episode.hostid) %-->.html"><!--% episode.host %--></a> on <span><!--% episode.date %--></span> is flagged as <span><!--% display_explicit(episode.explicit) %--></span> and is released under a <span><!--% episode.license %--> license</span>. <br> Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(episode.hostid) %-->.html"><!--% episode.host %--></a> on <span><!--% episode.date %--></span> is flagged as <span><!--% display_explicit(episode.explicit) %--></span> and is released under a <span><!--% episode.license %--> license</span>. <br>
<!--% display_tags(episode.tags) %--> <br> <!--% display_tags(episode.tags) %--> <br>
<!--% display_listen_in(episode.id) %--> <!--% display_listen_in(episode.id, "twat") %-->
</p> </p>
<h3><!--% show_series(episode.series, episode.seriesid, "Part of the series") %--></h3> <h3><!--% show_series(episode.series, episode.seriesid, "Part of the series") %--></h3>
<p><em><!--% episode.series_description %--></em></p> <p><em><!--% episode.series_description %--></em></p>
</header> </header>
<div><!--% episode.notes %--></div> <div><!--% episode.notes %--></div>
<footer> <footer>
<!--% listen_now(episode, "twat", baseurl, media_hostname) %--> <!--% listen_now(episode, "twat", baseurl, media_baseurl) %-->
<p> <p>
<!--% episode_navigation %--> <!--% episode_navigation %-->
</p> </p>

View File

@ -11,8 +11,15 @@
<span><label>Tags:</label> <em><!--% tags %--></em>.</span> <span><label>Tags:</label> <em><!--% tags %--></em>.</span>
<!--% END %--> <!--% END %-->
<!--% MACRO display_listen_in(eps_id) BLOCK %--> <!--% MACRO display_listen_in(eps_id, episode_type) BLOCK %-->
Listen in <a href="<!--% media_baseurl(baseurl, media_hostname) %-->local/hpr<!--% eps_id %-->.ogg">ogg</a>, <a href="<!--% media_baseurl(baseurl, media_hostname) %-->local/hpr<!--% eps_id %-->.spx">spx</a>, or <a href="<!--% media_baseurl(baseurl, media_hostname) %-->local/hpr<!--% eps_id %-->.mp3">mp3</a> format. <!--% IF episode_type == "" %--><!--% episode_type = 'hpr' %--><!--% END %-->
Listen in
<!--% IF episode_type == 'hpr' %-->
<a href="<!--% media_path(eps_id, episode_type, 'ogg', baseurl, media_baseurl) %-->">ogg</a>,
<a href="<!--% media_path(eps_id, episode_type, 'spx', baseurl, media_baseurl) %-->">spx</a>,
or
<!--% END %-->
<a href="<!--% media_path(eps_id, episode_type, 'mp3', baseurl, media_baseurl) %-->">mp3</a> format.
<!--% END %--> <!--% END %-->
<!--% MACRO display_comments_tally(eps_id, tally) BLOCK %--> <!--% MACRO display_comments_tally(eps_id, tally) BLOCK %-->

View File

@ -1,19 +1,16 @@
<!--% MACRO listen_now(episode, episode_type, baseurl, media_hostname) BLOCK %--> <!--% MACRO listen_now(episode, episode_type, baseurl, media_baseurl) BLOCK %-->
<!--% IF episode_type == "twat" %-->
<!--% media_folder = "eps" %--><!--% ELSE %--><!--% media_folder = "local" %-->
<!--% END %-->
<h2>Listen Now</h2> <h2>Listen Now</h2>
<p>Duration: <!--% display_episode_duration(episode.duration) %--></p> <p>Duration: <!--% display_episode_duration(episode.duration) %--></p>
<audio controls preload="none"> <audio controls preload="none">
<source src="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.ogg" type="audio/ogg" > <source src="<!--% media_path(episode.id, episode_type, 'ogg', baseurl, media_baseurl) %-->" type="audio/ogg" >
<source src="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.mp3" type="audio/mpeg" > <source src="<!--% media_path(episode.id, episode_type, 'mp3', baseurl, media_baseurl) %-->" type="audio/mpeg" >
</audio> </audio>
<ul> <ul>
<!--% IF episode_type != "twat" %--> <!--% IF episode_type != "twat" %-->
<li>ogg: <a href="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.ogg"><!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.ogg</a></li> <li>ogg: <a href="<!--% media_path(episode.id, episode_type, 'ogg', baseurl, media_baseurl) %-->"><!--% media_path(episode.id, episode_type, 'ogg', baseurl, media_baseurl) %--></a></li>
<li>spx: <a href="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.spx"><!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.spx</a></li> <li>spx: <a href="<!--% media_path(episode.id, episode_type, 'spx', baseurl, media_baseurl) %-->"><!--% media_path(episode.id, episode_type, 'spx', baseurl, media_baseurl) %--></a></li>
<!--% END %--> <!--% END %-->
<li>mp3: <a href="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.mp3"><!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.mp3</a></li> <li>mp3: <a href="<!--% media_path(episode.id, episode_type, 'mp3', baseurl, media_baseurl) %-->"><!--% media_path(episode.id, episode_type, 'mp3', baseurl, media_baseurl) %--></a></li>
</ul> </ul>
<!--% END %--> <!--% END %-->