From d33e78a2fa097bffd148402defe9298a0a88ffbc Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 19 Mar 2017 11:02:31 +0000 Subject: [PATCH] Limit previous talks on talks page, add talks archive --- source/_partials/talks-table.twig | 1 - source/talks.twig | 9 +++++---- source/talks/archive.twig | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 source/talks/archive.twig diff --git a/source/_partials/talks-table.twig b/source/_partials/talks-table.twig index 384d9c87..20e82961 100644 --- a/source/_partials/talks-table.twig +++ b/source/_partials/talks-table.twig @@ -9,7 +9,6 @@ - {% set events = reverse_order ? events|sortbyfield('date')|reverse : events|sortbyfield('date') %} {% for event in events %} diff --git a/source/talks.twig b/source/talks.twig index 798849e0..d6e268f3 100644 --- a/source/talks.twig +++ b/source/talks.twig @@ -29,15 +29,16 @@ use: [talks, posts]

Upcoming Talks

{% include "talks-table" with { - events: upcoming_events, + events: upcoming_events|sortbyfield('date'), show_talk: true } %} -

Previous Talks

+

Last 5 Talks

{% include "talks-table" with { - events: past_events, - reverse_order: true, + events: past_events|sortbyfield('date')|reverse[:5], show_feedback: true, show_talk: true } %} + +

You can view more talks in the talks archive.

diff --git a/source/talks/archive.twig b/source/talks/archive.twig new file mode 100644 index 00000000..509a1495 --- /dev/null +++ b/source/talks/archive.twig @@ -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 +} %}