oliverdavies.uk/source/_includes/podcast/other-episodes.html.twig

23 lines
584 B
Twig

{% set other_episodes = [] %}
{% for episode in all_episodes %}
{% if guest in episode.guests and episode.topic is not same as topic %}
{% set other_episodes = other_episodes|merge([episode]) %}
{% endif %}
{% endfor %}
{% if other_episodes is not empty %}
<section>
<h2>Other episodes with {{ guest }}</h2>
<ul>
{% for episode in other_episodes %}
<li>
<a href="{{ episode.url|trim('/', 'right') }}">{{ episode.topic }}</a>
- {{ episode.date|date('jS F Y') }}
</li>
{% endfor %}
</ul>
</section>
{% endif %}