Display the latest pod episodes on the front page

This commit is contained in:
davegson 2019-11-11 16:37:21 +01:00
parent 2c450e98d0
commit ca5df05a5b
3 changed files with 27 additions and 29 deletions

View file

@ -1,34 +1,16 @@
<content> <content>
<div class="cast"> <div class="cast">
<div class="c-l"> <div class="c-l">
<a href=""> {% assign sorted_podcasts = site.podcasts | reverse %}
<img src="{{ site.img_url }}podcast.png" alt=""> {% for episode in sorted_podcasts limit: 4 %}
<div> <a href="{{ episode.url }}">
<span>How to evaluate and trust a business?</span> <img src="{{ site.img_url }}podcast.png" alt="">
<p>#004</p> <div>
</div> <span>{{ episode.title | grab_title_only }}</span>
</a> <p>{{ episode.title | grab_episode_number }}</p>
<a href=""> </div>
<img src="{{ site.img_url }}podcast.png" alt=""> </a>
<div> {% endfor %}
<span>How to evaluate and trust a business?</span>
<p>#004</p>
</div>
</a>
<a href="">
<img src="{{ site.img_url }}podcast.png" alt="">
<div>
<span>How to evaluate and trust a business?</span>
<p>#004</p>
</div>
</a>
<a href="">
<img src="{{ site.img_url }}podcast.png" alt="">
<div>
<span>How to evaluate and trust a business?</span>
<p>#004</p>
</div>
</a>
</div> </div>
<div class="c-r"> <div class="c-r">
<h1>Stay up to date</h1> <h1>Stay up to date</h1>

View file

@ -0,0 +1,15 @@
module Jekyll
module PodcastHelper
# Format of a title:
# #001 - Some sweet title
def grab_episode_number(full_title)
full_title[0..4]
end
def grab_title_only(full_title)
full_title[7..-1]
end
end
end
Liquid::Template.register_filter(Jekyll::PodcastHelper)

View file

@ -5,7 +5,8 @@ layout: podcast
<div class="ui divided items"> <div class="ui divided items">
{% for episode in site.podcasts reversed %} {% assign sorted_podcasts = site.podcasts | reverse %}
{% for episode in sorted_podcasts %}
<div class="item"> <div class="item">
<div class="middle aligned content"> <div class="middle aligned content">
<a href="{{ episode.url }}">{{ episode.title }}</a> <a href="{{ episode.url }}">{{ episode.title }}</a>