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

51 lines
1.3 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";
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 = getSlugFromFile(talk.file);
2022-10-07 09:14:10 +01:00
2023-01-08 19:25:23 +00:00
return { slug, talk };
2022-10-07 09:14:10 +01:00
})
.sort((b, a) => {
const events = [
a.talk.frontmatter.events[a.talk.frontmatter.events.length - 1],
b.talk.frontmatter.events[b.talk.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
---
<PageLayout title="Talks and workshops">
2023-01-08 19:25:23 +00:00
<p>
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~
<div>
{
sortedTalks.map((talk) => (
<article>
<a href={`/talks/${talk.slug}`}>
<h2>{talk.talk.frontmatter.title}</h2>
</a>
{talk.talk.frontmatter.description}
</article>
))
}
</div>
</p>
2022-10-07 09:14:10 +01:00
</PageLayout>