From b1f7ea09e0a8d41a01bf065dc23990d846802a68 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 3 Jan 2024 20:00:00 +0000 Subject: [PATCH] Make talk count dynamic --- source/_pages/talks.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/_pages/talks.md b/source/_pages/talks.md index 4735f67c..56ff02fe 100644 --- a/source/_pages/talks.md +++ b/source/_pages/talks.md @@ -1,11 +1,17 @@ --- title: Talks and Workshops -talk_count: 94 use: - talks --- -Starting with my first talk in September 2012, I have given {{ page.talk_count }} public presentations and workshops at various conferences and meetups, in-person and remotely, on topics including PHP, Drupal, automated testing, Git, CSS, and systems administration. +{% set talkCount = 0 %} +{% for talk in data.talks %} + {% for event in talk.events if 'today'|date('U') >= event.date|date('U') %} + {% set talkCount = talkCount + 1 %} + {% endfor %} +{% endfor %} + +Starting with my first talk in September 2012, I have given {{ talkCount }} public presentations and workshops at various conferences and meetups, in-person and remotely, on topics including PHP, Drupal, automated testing, Git, CSS, and systems administration. {% for talk in data.talks|sort((a, b) => a.events|last.date|date('U') > b.events|last.date|date('U') ? -1 : 1) %}