oliverdavies.uk/src/pages/talks/index.astro

38 lines
1.1 KiB
Text
Raw Normal View History

2022-10-07 09:14:10 +01:00
---
2023-01-08 19:25:23 +00:00
import PageLayout from "~/layouts/PageLayout.astro";
import _ from "lodash";
import { getSlugFromFile } from "~/utils.ts";
import ListingPage from "~/components/ListingPage.astro";
2022-10-07 09:14:10 +01:00
2023-01-08 19:25:23 +00:00
const talks = await Astro.glob("../../talks/*.md");
2022-10-07 09:14:10 +01:00
2022-10-15 16:10:41 +01:00
const talkCount = _(talks)
.flatMap((talk) => talk.frontmatter.events)
2023-01-08 19:25:23 +00:00
.size();
2022-10-15 16:10:41 +01:00
2022-10-07 09:14:10 +01:00
const sortedTalks = talks
2023-01-08 19:25:23 +00:00
.map((talk) => {
const slug = `/talks/${getSlugFromFile(talk.file)}`;
2022-10-07 09:14:10 +01:00
return { slug, item: talk };
2022-10-07 09:14:10 +01:00
})
.sort((b, a) => {
const events = [
a.item.frontmatter.events[a.item.frontmatter.events.length - 1],
b.item.frontmatter.events[b.item.frontmatter.events.length - 1],
2023-01-08 19:25:23 +00:00
];
2022-10-07 09:14:10 +01:00
2023-01-08 19:25:23 +00:00
return (
new Date(events[0].date).valueOf() - new Date(events[1].date).valueOf()
);
});
2022-10-07 09:14:10 +01:00
---
<ListingPage items={sortedTalks} title="Talks and workshops">
<p slot="intro">
2023-01-08 19:25:23 +00:00
Starting with my first talk in September 2012, I have given {talkCount} presentations
and workshops at various conferences and meetups, in-person and remotely, on
topics including PHP, Drupal, automated testing, Git, CSS, and systems administration.
2023-01-08 19:25:23 +00:00
</p>
</ListingPage>