fix(talks): only count past talks

This commit is contained in:
Oliver Davies 2023-08-03 00:01:31 +01:00
parent d043c28fda
commit e9e0ae5b19

View file

@ -1,17 +1,18 @@
---
import ListingPage from "~/components/ListingPage.astro";
import Markdown from "~/components/Markdown.astro";
import _ from "lodash";
import { getCollection } from "astro:content";
import Markdown from "~/components/Markdown.astro";
const talks = await getCollection("talk");
const today = new Date().valueOf();
const talkCount = _(talks)
.flatMap((talk) => talk.data.events)
.filter((event): boolean => new Date(event.date).valueOf() <= today)
.size();
const today = new Date().valueOf();
const sortedTalks = talks
.map((talk) => {
const slug = `/talks/${talk.slug}`;