refactor: move website files to the root level

This commit is contained in:
Oliver Davies 2023-03-21 20:44:42 +00:00
parent c2887ecbc5
commit 2cbbfd60ff
590 changed files with 0 additions and 4484 deletions

View file

@ -0,0 +1,41 @@
---
import AboutMe from "~/components/AboutMe.astro";
import Events from "~/components/talk/Events.astro";
import Layout from "~/layouts/Layout.astro";
import Markdown from "~/components/Markdown.astro";
import Slides from "~/components/talk/Slides.astro";
import Video from "~/components/talk/Video.astro";
import { getSlugFromFile } from "~/utils.ts";
export async function getStaticPaths() {
const talks = await Astro.glob("../../talks/*.md");
return talks.map((talk) => {
const slug = getSlugFromFile(talk.file);
return {
params: { slug },
props: { talk },
};
});
}
const { Content } = Astro.props.talk;
const { events, speakerdeck, title, video } = Astro.props.talk.frontmatter;
---
<Layout title={title}>
<div class="space-y-6">
<Markdown>
<Content />
</Markdown>
{speakerdeck && <Slides id={speakerdeck.id} ratio={speakerdeck.ratio} />}
{video && <Video id={video.id} type={video.type} />}
<Events events={events} />
<AboutMe />
</div>
</Layout>

View file

@ -0,0 +1,37 @@
---
import PageLayout from "~/layouts/PageLayout.astro";
import _ from "lodash";
import { getSlugFromFile } from "~/utils.ts";
import ListingPage from "~/components/ListingPage.astro";
const talks = await Astro.glob("../../talks/*.md");
const talkCount = _(talks)
.flatMap((talk) => talk.frontmatter.events)
.size();
const sortedTalks = talks
.map((talk) => {
const slug = `/talks/${getSlugFromFile(talk.file)}`;
return { slug, item: talk };
})
.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],
];
return (
new Date(events[0].date).valueOf() - new Date(events[1].date).valueOf()
);
});
---
<ListingPage items={sortedTalks} title="Talks and workshops">
<p slot="intro">
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.
</p>
</ListingPage>