mirror of
https://github.com/safing/web
synced 2025-09-01 18:49:06 +00:00
Display the latest pod episodes on the front page
This commit is contained in:
parent
2c450e98d0
commit
ca5df05a5b
3 changed files with 27 additions and 29 deletions
|
@ -1,34 +1,16 @@
|
|||
<content>
|
||||
<div class="cast">
|
||||
<div class="c-l">
|
||||
<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>
|
||||
<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>
|
||||
{% assign sorted_podcasts = site.podcasts | reverse %}
|
||||
{% for episode in sorted_podcasts limit: 4 %}
|
||||
<a href="{{ episode.url }}">
|
||||
<img src="{{ site.img_url }}podcast.png" alt="">
|
||||
<div>
|
||||
<span>{{ episode.title | grab_title_only }}</span>
|
||||
<p>{{ episode.title | grab_episode_number }}</p>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="c-r">
|
||||
<h1>Stay up to date</h1>
|
||||
|
|
15
_plugins/podcast_helper.rb
Normal file
15
_plugins/podcast_helper.rb
Normal 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)
|
|
@ -5,7 +5,8 @@ layout: podcast
|
|||
|
||||
|
||||
<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="middle aligned content">
|
||||
<a href="{{ episode.url }}">{{ episode.title }}</a>
|
||||
|
|
Loading…
Add table
Reference in a new issue