<!--% MACRO zero_pad_left(word, pad_length) BLOCK %-->
        <!--% IF pad_length %-->
                <!--% zero_pad_format = "%0${pad_length}s" %-->
        <!--% ELSE %-->
                <!--% zero_pad_format = "%04s" %-->
        <!--% END %-->
        <!--% USE String(word) %-->
        <!--% String.format(zero_pad_format) %-->
<!--% END %-->

<!--% MACRO display_choice(choice, display_when_true, display_when_false) BLOCK %-->
<!--% IF choice == 1 %--><!--% display_when_true %-->
<!--% ELSE %--><!--% display_when_false %--><!--% END %-->
<!--% END %-->

<!--% MACRO display_episode_duration(duration_sec) BLOCK %-->
<!--% seconds = duration_sec % 60 %-->
<!--% USE format %-->
<!--% minutes_only = format("%d") %-->
<!--% minutes = minutes_only(duration_sec / 60) %-->
<!--% hours_only = format("%d") %-->
<!--% hours = hours_only(minutes / 60) %-->
<!--% IF hours >= 1 %-->
<!--% minutes = minutes - hours * 60 %-->
<!--% END %-->
<!--% display_hours = format("%02d:%02d:%02d") %-->
<!--% display_hours(hours,minutes,seconds) %-->
<!--% END %-->

<!--% MACRO display_explicit(is_explicit) BLOCK %-->
<!--% display_choice(is_explicit, 'Explicit', 'Clean') %-->
<!--% END %-->

<!--% MACRO display_explicit_feed(is_explicit) BLOCK %-->
<!--% display_choice(is_explicit, 'yes', 'no') %-->
<!--% END %-->

<!--% MACRO display_explicit_feed_2(is_explicit) BLOCK %-->
<!--% display_choice(is_explicit, 'Yes', 'No') %-->
<!--% END %-->

<!--% MACRO format_feed_date(date_to_format) BLOCK %-->
<!--% USE feed_date = date(format = '%a, %d %b %Y %H:%M:%S +0000', gmt=1)  %-->
<!--% feed_date.format(date_to_format) %-->
<!--% END %-->

<!--% MACRO format_iso8601_date(date_to_format) BLOCK %-->
<!--% USE iso8601_date = date(format = '%Y-%m-%dT%H:%M:%SZ', gmt=1)  %-->
<!--% iso8601_date.format(date_to_format) %-->
<!--% END %-->

<!--% MACRO day_from_date(eps_date) BLOCK %-->
<!--% USE eps_day = date(format => '%A', locale => 'en_US', gmt => 1)  %-->
<!--% eps_day.format("$eps_date 0:0:0") %-->
<!--% END %-->

<!--% MACRO day_and_date(eps_date) BLOCK %-->
<!--% day_from_date(eps_date) %-->, <!--% eps_date %-->
<!--% END %-->

<!--% MACRO tag_to_id(tag, is_index) BLOCK %-->
<!--% tag = tag.replace('\s+','_') %-->
<!--% IF is_index %-->
    <!--% tag.upper %-->
<!--% ELSE %-->
    <!--% tag.lower %-->
<!--% END %-->
<!--% END %-->

<!--% MACRO absolute_url(base, path) BLOCK %-->
<!--% UNLESS base.empty %-->
    <!--% UNLESS base.substr(-1) == '/' %-->
        <!--% base = base _ '/' %-->
    <!--% END %-->
<!--% END %-->
<!--% UNLESS path.empty %-->
    <!--% IF path.substr(0,1) == '/' %-->
        <!--% path = path.substr(1) %-->
    <!--% END %-->
<!--% END %-->
<!--% base _ path %-->
<!--% END %-->

<!--% MACRO absolute_path(baseurl) BLOCK %-->
<!--% IF baseurl %-->./<!--% ELSE %-->/<!--% END %-->
<!--% END %-->

<!--% MACRO media_basepath(baseurl, media_baseurl) BLOCK %-->
<!--% IF media_baseurl %-->
<!--% media_baseurl %--><!--% ELSE %-->
<!--% IF baseurl %--><!--% baseurl %--><!--% ELSE %-->/<!--% END %-->
<!--% END %-->
<!--% END %-->

<!--% MACRO media_path(episode_id, episode_type, media_type, baseurl, media_baseurl) BLOCK %-->
        <!--% IF episode_type == "twt" %-->
                <!--% episode_type = "twt" %-->
                <!--% padding = 3 %-->
                <!--% media_folder = "eps/"; padding = 3 %-->
        <!--% ELSE %-->
                <!--% media_folder = "local/" %-->
        <!--% END %-->
        <!--% IF media_baseurl %-->
                <!--% transcription_types = "txt srt vtt" %-->
                <!--% USE String(transcription_types) %-->
                <!--% USE String(media_baseurl) %-->
                        <!--% IF transcription_types.search(media_type) && media_baseurl.search('archive.org') %-->
                        <!--% media_baseurl = "${media_baseurl}hpr\$eps_id/" %-->
                <!--% END %-->
                <!--% media_folder = "" %-->
                <!--% media_baseurl = media_baseurl.replace('hpr\$eps_id', episode_type _ zero_pad_left(episode_id, padding)) %-->
        <!--% END %-->
        <!--% media_basepath(baseurl, media_baseurl) %--><!--% media_folder %--><!--% episode_type %--><!--% zero_pad_left(episode_id, padding) %-->.<!--% media_type %-->
<!--% END %-->

<!--% MACRO step_navigation(baseurl, links, folder) BLOCK %-->
<!--% IF folder %-->
<!--% folder = folder %--><!--% ELSE %--><!--% folder = "hpr" %-->
<!--% END %-->
<!--% arrow_first = "arrow-first.svg" %--> 
<!--% arrow_prev = "arrow-previous.svg" %--> 
<!--% arrow_next = "arrow-next.svg" %--> 
<!--% arrow_last = "arrow-last.svg" %--> 
<nav class="episodes" aria-description="Navigation to other episodes"><span><a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.earliest) %-->/index.html" rel="first" aria-label="first episode"><!--% INSERT $arrow_first %--><span class="no-css">&lt;&lt; </span>First</a></span>,
    <!--% IF links.previous %-->
    <span><a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.previous) %-->/index.html" rel="previous" aria-label="previous episode"><!--% INSERT $arrow_prev %--><span class="no-css">&lt; </span>Previous</a></span>,
    <!--% ELSE %-->
    <span class="no-link"><!--% INSERT $arrow_prev %--><span class="no-css">&lt; </span>Previous</span>,
    <!--% END %-->
    <!--% IF links.next %-->
	<span><a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.next) %-->/index.html" rel="next" aria-label="next episode">Next<span class="no-css"> &gt;</span><!--% INSERT $arrow_next %--></a></span>, 
    <!--% ELSE %-->
	<span class="no-link">Next<span class="no-css"> &gt;</span><!--% INSERT $arrow_next %--></span>, 
    <!--% END %-->
	<span><a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.latest) %-->/index.html" rel="last" aria-label="latest episode">Latest<span class="no-css"> &gt;&gt;</span><!--% INSERT $arrow_last %--></a></span></nav>
<!--% END %-->

<!--% MACRO get_new_year_show_start BLOCK %-->
<!--% start_year = date.format(date.now, '%Y') %-->	
<!--% IF date.format(date.now, '%m') != 12 || date.format(date.now, '%j') == 1 %-->
	<!--% start_year = start_year - 1 %-->
<!--% END %-->
	<time datetime="<!--% start_year %-->-12-31T10:00Z"><!--% start_year %-->-12-31 10:00 UTC (5:00 AM EST)</time>
<!--% END %--> 

<!--% MACRO get_new_year_show_end BLOCK %-->
<!--% end_year = date.format(date.now, '%Y') %-->	
<!--% IF date.format(date.now, '%m') == 12 || date.format(date.now, '%j') == 1 %-->
	<!--% end_year = end_year + 1 %-->
<!--% END %-->
	<time datetime="<!--% end_year %-->-01-01T12:00Z"><!--% end_year %-->-01-01 12:00 UTC (7:00 AM EST)</time>
<!--% END %-->

<!--% MACRO get_new_year_show_ordinal_year BLOCK %-->
<!--% ordinal_year = date.format(date.now, '%Y') - 2011 %-->
<!--% IF date.format(date.now, '%m') != 12 || date.format(date.now, '%j') == 1 %-->
	<!--% ordinal_year = ordinal_year - 1 %-->
<!--% END %-->
<!--% years.0 = 'th'
	  years.1 = 'st'
	  years.2 = 'nd'
	  years.3 = 'rd'
	  years.4 = 'th'
	  years.5 = 'th'
	  years.6 = 'th'
	  years.7 = 'th'
	  years.8 = 'th'
	  years.9 = 'th'
	  years.14 = 'Fourteenth'
	  years.15 = 'Fifteenth' 
	  years.16 = 'Sixteenth' 
	  years.17 = 'Seventeenth' 
	  years.18 = 'Eighteenth' 
	  years.19 = 'Nineteenth' 
	  years.20 = 'Twentieth'
	  years.30 = 'Thirtieth'
	  years.40 = 'Fortieth' 
	  years.50 = 'Fiftieth' %-->
<!--% index = ordinal_year % 10 %-->
<!--% IF ordinal_year < 21 || (index == 0 && ordinal_year < 51) %-->
	<!--% years.$ordinal_year %-->
<!--% ELSE %-->
<!--% ordinal_year %--><sup><!--% years.$index %--></sup>
<!--% END %-->
<!--% END %-->

<!--% MACRO make_sfw(swf, sfw_text, nsfw_text) BLOCK %-->
<!--% IF swf == 0 %--><!--% sfw_text %-->
<!--% ELSE %--><!--% nsfw_text %-->
<!--% END %--><!--% END %-->
