Limit previous talks on talks page, add talks archive

This commit is contained in:
Oliver Davies 2017-03-19 11:02:31 +00:00
parent 64bf53cc69
commit d33e78a2fa
3 changed files with 23 additions and 5 deletions

View file

@ -9,7 +9,6 @@
</tr>
</thead>
<tbody>
{% set events = reverse_order ? events|sortbyfield('date')|reverse : events|sortbyfield('date') %}
{% for event in events %}
<tr>
<td class="date">

View file

@ -29,15 +29,16 @@ use: [talks, posts]
<h2>Upcoming Talks</h2>
{% include "talks-table" with {
events: upcoming_events,
events: upcoming_events|sortbyfield('date'),
show_talk: true
} %}
<h2>Previous Talks</h2>
<h2>Last 5 Talks</h2>
{% include "talks-table" with {
events: past_events,
reverse_order: true,
events: past_events|sortbyfield('date')|reverse[:5],
show_feedback: true,
show_talk: true
} %}
<p>You can view more talks in the <a href="/talks/archive">talks archive</a>.</p>

18
source/talks/archive.twig Normal file
View file

@ -0,0 +1,18 @@
---
title: Talk Archive
layout: page
use: [talks]
---
{% set events = [] %}
{% for talk in data.talks %}
{% for event in talk.events if event.date < 'today'|date('Y-m-d') %}
{% set event = event|merge({ talk: talk })|merge(site.events[event.id]) %}
{% set events = events|merge([event]) %}
{% endfor %}
{% endfor %}
{% include "talks-table" with {
events: events|sortbyfield('date')|reverse,
show_feedback: true,
show_talk: true
} %}