From 7b97ad3af2c342a52374b69a110e1120cc06cacc Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 9 Apr 2023 10:17:52 +0100 Subject: [PATCH] refactor: use a content collection for talks --- .astro/types.d.ts | 142 +++++++++--------- src/components/ListingPageItem.astro | 3 +- src/content/config.ts | 20 +++ .../talk}/about-drupal-association.md | 0 ...esting-test-driven-development-drupal-8.md | 0 ...building-presenting-slide-decks-rst2pdf.md | 0 .../talk}/building-static-websites-sculpin.md | 0 .../configuring-all-the-things-drupal-8.md | 0 .../talk}/dancing-for-drupal.md | 0 .../talk}/decoupling-drupal-vuejs.md | 0 .../talk}/deploying-drupal-fabric.md | 1 + .../talk}/deploying-php-ansible-ansistrano.md | 1 - .../talk}/deploying-php-fabric.md | 0 .../talk}/drupal-8-module-development.md | 0 .../drupal-8-php-libraries-drupalorg-api.md | 0 .../talk}/drupal-8-rejoining-the-herd.md | 0 src/{talks => content/talk}/drupal-8.md | 0 .../talk}/drupal-ldap-module.md | 0 .../talk}/drupal-vm-generator.md | 0 .../talk}/drupal-vm-meet-symfony-console.md | 0 src/{talks => content/talk}/drupalorg-2015.md | 0 .../talk}/drush-make-drupalbristol.md | 0 .../talk}/getting-your-data-into-drupal-8.md | 0 src/{talks => content/talk}/git-flow.md | 0 .../goodbye-drush-make-hello-composer.md | 0 .../talk}/introduction-to-mob-programming.md | 1 + .../talk}/it-all-started-with-a-patch.md | 0 ...modern-drupal-development-with-composer.md | 0 .../talk}/out-of-the-box-initiative-update.md | 0 .../talk}/so-what-is-this-drupal-thing.md | 0 .../talk}/taking-flight-with-tailwind-css.md | 0 .../talk}/tdd-test-driven-drupal.md | 0 .../talk}/test-drive-twig-with-sculpin.md | 0 .../talk}/things-you-should-know-about-php.md | 0 .../talk}/upgrading-your-site-drupal-9.md | 0 ...-illuminate-collections-outside-laravel.md | 0 .../talk}/working-with-workspace.md | 0 .../talk}/working-without-workspace.md | 3 +- src/env.d.ts | 1 + src/pages/talks/[slug].astro | 11 +- src/pages/talks/index.astro | 15 +- tsconfig.json | 5 +- 42 files changed, 111 insertions(+), 92 deletions(-) create mode 100644 src/content/config.ts rename src/{talks => content/talk}/about-drupal-association.md (100%) rename src/{talks => content/talk}/automated-testing-test-driven-development-drupal-8.md (100%) rename src/{talks => content/talk}/building-presenting-slide-decks-rst2pdf.md (100%) rename src/{talks => content/talk}/building-static-websites-sculpin.md (100%) rename src/{talks => content/talk}/configuring-all-the-things-drupal-8.md (100%) rename src/{talks => content/talk}/dancing-for-drupal.md (100%) rename src/{talks => content/talk}/decoupling-drupal-vuejs.md (100%) rename src/{talks => content/talk}/deploying-drupal-fabric.md (98%) rename src/{talks => content/talk}/deploying-php-ansible-ansistrano.md (99%) rename src/{talks => content/talk}/deploying-php-fabric.md (100%) rename src/{talks => content/talk}/drupal-8-module-development.md (100%) rename src/{talks => content/talk}/drupal-8-php-libraries-drupalorg-api.md (100%) rename src/{talks => content/talk}/drupal-8-rejoining-the-herd.md (100%) rename src/{talks => content/talk}/drupal-8.md (100%) rename src/{talks => content/talk}/drupal-ldap-module.md (100%) rename src/{talks => content/talk}/drupal-vm-generator.md (100%) rename src/{talks => content/talk}/drupal-vm-meet-symfony-console.md (100%) rename src/{talks => content/talk}/drupalorg-2015.md (100%) rename src/{talks => content/talk}/drush-make-drupalbristol.md (100%) rename src/{talks => content/talk}/getting-your-data-into-drupal-8.md (100%) rename src/{talks => content/talk}/git-flow.md (100%) rename src/{talks => content/talk}/goodbye-drush-make-hello-composer.md (100%) rename src/{talks => content/talk}/introduction-to-mob-programming.md (94%) rename src/{talks => content/talk}/it-all-started-with-a-patch.md (100%) rename src/{talks => content/talk}/modern-drupal-development-with-composer.md (100%) rename src/{talks => content/talk}/out-of-the-box-initiative-update.md (100%) rename src/{talks => content/talk}/so-what-is-this-drupal-thing.md (100%) rename src/{talks => content/talk}/taking-flight-with-tailwind-css.md (100%) rename src/{talks => content/talk}/tdd-test-driven-drupal.md (100%) rename src/{talks => content/talk}/test-drive-twig-with-sculpin.md (100%) rename src/{talks => content/talk}/things-you-should-know-about-php.md (100%) rename src/{talks => content/talk}/upgrading-your-site-drupal-9.md (100%) rename src/{talks => content/talk}/using-illuminate-collections-outside-laravel.md (100%) rename src/{talks => content/talk}/working-with-workspace.md (100%) rename src/{talks => content/talk}/working-without-workspace.md (95%) diff --git a/.astro/types.d.ts b/.astro/types.d.ts index f8513411..7e36b02a 100644 --- a/.astro/types.d.ts +++ b/.astro/types.d.ts @@ -111,251 +111,251 @@ declare module 'astro:content' { >; const entryMap: { - "talks": { + "talk": { "about-drupal-association.md": { id: "about-drupal-association.md", slug: "about-drupal-association", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "automated-testing-test-driven-development-drupal-8.md": { id: "automated-testing-test-driven-development-drupal-8.md", slug: "automated-testing-test-driven-development-drupal-8", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "building-presenting-slide-decks-rst2pdf.md": { id: "building-presenting-slide-decks-rst2pdf.md", slug: "building-presenting-slide-decks-rst2pdf", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "building-static-websites-sculpin.md": { id: "building-static-websites-sculpin.md", slug: "building-static-websites-sculpin", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "configuring-all-the-things-drupal-8.md": { id: "configuring-all-the-things-drupal-8.md", slug: "configuring-all-the-things-drupal-8", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "dancing-for-drupal.md": { id: "dancing-for-drupal.md", slug: "dancing-for-drupal", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "decoupling-drupal-vuejs.md": { id: "decoupling-drupal-vuejs.md", slug: "decoupling-drupal-vuejs", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "deploying-drupal-fabric.md": { id: "deploying-drupal-fabric.md", slug: "deploying-drupal-fabric", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "deploying-php-ansible-ansistrano.md": { id: "deploying-php-ansible-ansistrano.md", slug: "deploying-php-ansible-ansistrano", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "deploying-php-fabric.md": { id: "deploying-php-fabric.md", slug: "deploying-php-fabric", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupal-8-module-development.md": { id: "drupal-8-module-development.md", slug: "drupal-8-module-development", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupal-8-php-libraries-drupalorg-api.md": { id: "drupal-8-php-libraries-drupalorg-api.md", slug: "drupal-8-php-libraries-drupalorg-api", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupal-8-rejoining-the-herd.md": { id: "drupal-8-rejoining-the-herd.md", slug: "drupal-8-rejoining-the-herd", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupal-8.md": { id: "drupal-8.md", slug: "drupal-8", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupal-ldap-module.md": { id: "drupal-ldap-module.md", slug: "drupal-ldap-module", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupal-vm-generator.md": { id: "drupal-vm-generator.md", slug: "drupal-vm-generator", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupal-vm-meet-symfony-console.md": { id: "drupal-vm-meet-symfony-console.md", slug: "drupal-vm-meet-symfony-console", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drupalorg-2015.md": { id: "drupalorg-2015.md", slug: "drupalorg-2015", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "drush-make-drupalbristol.md": { id: "drush-make-drupalbristol.md", slug: "drush-make-drupalbristol", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "getting-your-data-into-drupal-8.md": { id: "getting-your-data-into-drupal-8.md", slug: "getting-your-data-into-drupal-8", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "git-flow.md": { id: "git-flow.md", slug: "git-flow", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "goodbye-drush-make-hello-composer.md": { id: "goodbye-drush-make-hello-composer.md", slug: "goodbye-drush-make-hello-composer", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "introduction-to-mob-programming.md": { id: "introduction-to-mob-programming.md", slug: "introduction-to-mob-programming", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "it-all-started-with-a-patch.md": { id: "it-all-started-with-a-patch.md", slug: "it-all-started-with-a-patch", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "modern-drupal-development-with-composer.md": { id: "modern-drupal-development-with-composer.md", slug: "modern-drupal-development-with-composer", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "out-of-the-box-initiative-update.md": { id: "out-of-the-box-initiative-update.md", slug: "out-of-the-box-initiative-update", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "so-what-is-this-drupal-thing.md": { id: "so-what-is-this-drupal-thing.md", slug: "so-what-is-this-drupal-thing", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "taking-flight-with-tailwind-css.md": { id: "taking-flight-with-tailwind-css.md", slug: "taking-flight-with-tailwind-css", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "tdd-test-driven-drupal.md": { id: "tdd-test-driven-drupal.md", slug: "tdd-test-driven-drupal", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "test-drive-twig-with-sculpin.md": { id: "test-drive-twig-with-sculpin.md", slug: "test-drive-twig-with-sculpin", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "things-you-should-know-about-php.md": { id: "things-you-should-know-about-php.md", slug: "things-you-should-know-about-php", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "upgrading-your-site-drupal-9.md": { id: "upgrading-your-site-drupal-9.md", slug: "upgrading-your-site-drupal-9", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "using-illuminate-collections-outside-laravel.md": { id: "using-illuminate-collections-outside-laravel.md", slug: "using-illuminate-collections-outside-laravel", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "working-with-workspace.md": { id: "working-with-workspace.md", slug: "working-with-workspace", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, "working-without-workspace.md": { id: "working-without-workspace.md", slug: "working-without-workspace", body: string, - collection: "talks", - data: any + collection: "talk", + data: InferEntrySchema<"talk"> } & { render(): Render[".md"] }, }, diff --git a/src/components/ListingPageItem.astro b/src/components/ListingPageItem.astro index 3f67ea9a..3e15094f 100644 --- a/src/components/ListingPageItem.astro +++ b/src/components/ListingPageItem.astro @@ -6,8 +6,7 @@ interface ItemProps { title: string; } -const { date, description, excerpt, title } = Astro.props.item.item - .frontmatter as ItemProps; +const { date, description, excerpt, title } = Astro.props.item.item.data as ItemProps; const { slug } = Astro.props.item; --- diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 00000000..723d95b0 --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,20 @@ +import { defineCollection, z } from 'astro:content'; + +const talkCollection = defineCollection({ + schema: z.object({ + description: z.string(), + events: z.array(z.object({ + date: z.string(), + location: z.string().optional(), + name: z.string(), + online: z.boolean().optional(), + })), + title: z.string(), + // TODO: add SpeakerDeck + // TODO: add Video + }), +}); + +export const collections = { + 'talk': talkCollection, +}; diff --git a/src/talks/about-drupal-association.md b/src/content/talk/about-drupal-association.md similarity index 100% rename from src/talks/about-drupal-association.md rename to src/content/talk/about-drupal-association.md diff --git a/src/talks/automated-testing-test-driven-development-drupal-8.md b/src/content/talk/automated-testing-test-driven-development-drupal-8.md similarity index 100% rename from src/talks/automated-testing-test-driven-development-drupal-8.md rename to src/content/talk/automated-testing-test-driven-development-drupal-8.md diff --git a/src/talks/building-presenting-slide-decks-rst2pdf.md b/src/content/talk/building-presenting-slide-decks-rst2pdf.md similarity index 100% rename from src/talks/building-presenting-slide-decks-rst2pdf.md rename to src/content/talk/building-presenting-slide-decks-rst2pdf.md diff --git a/src/talks/building-static-websites-sculpin.md b/src/content/talk/building-static-websites-sculpin.md similarity index 100% rename from src/talks/building-static-websites-sculpin.md rename to src/content/talk/building-static-websites-sculpin.md diff --git a/src/talks/configuring-all-the-things-drupal-8.md b/src/content/talk/configuring-all-the-things-drupal-8.md similarity index 100% rename from src/talks/configuring-all-the-things-drupal-8.md rename to src/content/talk/configuring-all-the-things-drupal-8.md diff --git a/src/talks/dancing-for-drupal.md b/src/content/talk/dancing-for-drupal.md similarity index 100% rename from src/talks/dancing-for-drupal.md rename to src/content/talk/dancing-for-drupal.md diff --git a/src/talks/decoupling-drupal-vuejs.md b/src/content/talk/decoupling-drupal-vuejs.md similarity index 100% rename from src/talks/decoupling-drupal-vuejs.md rename to src/content/talk/decoupling-drupal-vuejs.md diff --git a/src/talks/deploying-drupal-fabric.md b/src/content/talk/deploying-drupal-fabric.md similarity index 98% rename from src/talks/deploying-drupal-fabric.md rename to src/content/talk/deploying-drupal-fabric.md index a290e232..8d2f8efc 100644 --- a/src/talks/deploying-drupal-fabric.md +++ b/src/content/talk/deploying-drupal-fabric.md @@ -21,6 +21,7 @@ events: time: "15:00 - 15:40" - name: Drupal Somerset + location: Glastonbury, UK date: "2017-10-26" --- diff --git a/src/talks/deploying-php-ansible-ansistrano.md b/src/content/talk/deploying-php-ansible-ansistrano.md similarity index 99% rename from src/talks/deploying-php-ansible-ansistrano.md rename to src/content/talk/deploying-php-ansible-ansistrano.md index feb14901..cae2cbbf 100644 --- a/src/talks/deploying-php-ansible-ansistrano.md +++ b/src/content/talk/deploying-php-ansible-ansistrano.md @@ -69,7 +69,6 @@ events: - name: Midwest PHP date: "2021-04-23" - location: ~ url: https://midwestphp.org/talks/1q5XUF2tTdXXLYOoujMkpF/Deploying_PHP_applications_with_Ansible_Ansible_Vault_and_Ansistrano online: true diff --git a/src/talks/deploying-php-fabric.md b/src/content/talk/deploying-php-fabric.md similarity index 100% rename from src/talks/deploying-php-fabric.md rename to src/content/talk/deploying-php-fabric.md diff --git a/src/talks/drupal-8-module-development.md b/src/content/talk/drupal-8-module-development.md similarity index 100% rename from src/talks/drupal-8-module-development.md rename to src/content/talk/drupal-8-module-development.md diff --git a/src/talks/drupal-8-php-libraries-drupalorg-api.md b/src/content/talk/drupal-8-php-libraries-drupalorg-api.md similarity index 100% rename from src/talks/drupal-8-php-libraries-drupalorg-api.md rename to src/content/talk/drupal-8-php-libraries-drupalorg-api.md diff --git a/src/talks/drupal-8-rejoining-the-herd.md b/src/content/talk/drupal-8-rejoining-the-herd.md similarity index 100% rename from src/talks/drupal-8-rejoining-the-herd.md rename to src/content/talk/drupal-8-rejoining-the-herd.md diff --git a/src/talks/drupal-8.md b/src/content/talk/drupal-8.md similarity index 100% rename from src/talks/drupal-8.md rename to src/content/talk/drupal-8.md diff --git a/src/talks/drupal-ldap-module.md b/src/content/talk/drupal-ldap-module.md similarity index 100% rename from src/talks/drupal-ldap-module.md rename to src/content/talk/drupal-ldap-module.md diff --git a/src/talks/drupal-vm-generator.md b/src/content/talk/drupal-vm-generator.md similarity index 100% rename from src/talks/drupal-vm-generator.md rename to src/content/talk/drupal-vm-generator.md diff --git a/src/talks/drupal-vm-meet-symfony-console.md b/src/content/talk/drupal-vm-meet-symfony-console.md similarity index 100% rename from src/talks/drupal-vm-meet-symfony-console.md rename to src/content/talk/drupal-vm-meet-symfony-console.md diff --git a/src/talks/drupalorg-2015.md b/src/content/talk/drupalorg-2015.md similarity index 100% rename from src/talks/drupalorg-2015.md rename to src/content/talk/drupalorg-2015.md diff --git a/src/talks/drush-make-drupalbristol.md b/src/content/talk/drush-make-drupalbristol.md similarity index 100% rename from src/talks/drush-make-drupalbristol.md rename to src/content/talk/drush-make-drupalbristol.md diff --git a/src/talks/getting-your-data-into-drupal-8.md b/src/content/talk/getting-your-data-into-drupal-8.md similarity index 100% rename from src/talks/getting-your-data-into-drupal-8.md rename to src/content/talk/getting-your-data-into-drupal-8.md diff --git a/src/talks/git-flow.md b/src/content/talk/git-flow.md similarity index 100% rename from src/talks/git-flow.md rename to src/content/talk/git-flow.md diff --git a/src/talks/goodbye-drush-make-hello-composer.md b/src/content/talk/goodbye-drush-make-hello-composer.md similarity index 100% rename from src/talks/goodbye-drush-make-hello-composer.md rename to src/content/talk/goodbye-drush-make-hello-composer.md diff --git a/src/talks/introduction-to-mob-programming.md b/src/content/talk/introduction-to-mob-programming.md similarity index 94% rename from src/talks/introduction-to-mob-programming.md rename to src/content/talk/introduction-to-mob-programming.md index 3fa8c6bd..f4e1c543 100644 --- a/src/talks/introduction-to-mob-programming.md +++ b/src/content/talk/introduction-to-mob-programming.md @@ -1,5 +1,6 @@ --- title: An introduction to mob programming +description: '' speakerdeck: id: f37b16f915d64bc0b4a20f9f965e5353 ratio: 1.77725118483412 diff --git a/src/talks/it-all-started-with-a-patch.md b/src/content/talk/it-all-started-with-a-patch.md similarity index 100% rename from src/talks/it-all-started-with-a-patch.md rename to src/content/talk/it-all-started-with-a-patch.md diff --git a/src/talks/modern-drupal-development-with-composer.md b/src/content/talk/modern-drupal-development-with-composer.md similarity index 100% rename from src/talks/modern-drupal-development-with-composer.md rename to src/content/talk/modern-drupal-development-with-composer.md diff --git a/src/talks/out-of-the-box-initiative-update.md b/src/content/talk/out-of-the-box-initiative-update.md similarity index 100% rename from src/talks/out-of-the-box-initiative-update.md rename to src/content/talk/out-of-the-box-initiative-update.md diff --git a/src/talks/so-what-is-this-drupal-thing.md b/src/content/talk/so-what-is-this-drupal-thing.md similarity index 100% rename from src/talks/so-what-is-this-drupal-thing.md rename to src/content/talk/so-what-is-this-drupal-thing.md diff --git a/src/talks/taking-flight-with-tailwind-css.md b/src/content/talk/taking-flight-with-tailwind-css.md similarity index 100% rename from src/talks/taking-flight-with-tailwind-css.md rename to src/content/talk/taking-flight-with-tailwind-css.md diff --git a/src/talks/tdd-test-driven-drupal.md b/src/content/talk/tdd-test-driven-drupal.md similarity index 100% rename from src/talks/tdd-test-driven-drupal.md rename to src/content/talk/tdd-test-driven-drupal.md diff --git a/src/talks/test-drive-twig-with-sculpin.md b/src/content/talk/test-drive-twig-with-sculpin.md similarity index 100% rename from src/talks/test-drive-twig-with-sculpin.md rename to src/content/talk/test-drive-twig-with-sculpin.md diff --git a/src/talks/things-you-should-know-about-php.md b/src/content/talk/things-you-should-know-about-php.md similarity index 100% rename from src/talks/things-you-should-know-about-php.md rename to src/content/talk/things-you-should-know-about-php.md diff --git a/src/talks/upgrading-your-site-drupal-9.md b/src/content/talk/upgrading-your-site-drupal-9.md similarity index 100% rename from src/talks/upgrading-your-site-drupal-9.md rename to src/content/talk/upgrading-your-site-drupal-9.md diff --git a/src/talks/using-illuminate-collections-outside-laravel.md b/src/content/talk/using-illuminate-collections-outside-laravel.md similarity index 100% rename from src/talks/using-illuminate-collections-outside-laravel.md rename to src/content/talk/using-illuminate-collections-outside-laravel.md diff --git a/src/talks/working-with-workspace.md b/src/content/talk/working-with-workspace.md similarity index 100% rename from src/talks/working-with-workspace.md rename to src/content/talk/working-with-workspace.md diff --git a/src/talks/working-without-workspace.md b/src/content/talk/working-without-workspace.md similarity index 95% rename from src/talks/working-without-workspace.md rename to src/content/talk/working-without-workspace.md index ddba4bf7..d0fe3d6b 100644 --- a/src/talks/working-without-workspace.md +++ b/src/content/talk/working-without-workspace.md @@ -1,6 +1,6 @@ --- title: Working without Workspace -description: ~ +description: '' speakerdeck: id: dd406a45f04047fda765346b75efa3c3 ratio: "1.77798682972719" @@ -12,4 +12,3 @@ events: url: https://www.meetup.com/phplondon/events/292657869 date: "2023-04-06" --- - diff --git a/src/env.d.ts b/src/env.d.ts index f964fe0c..acef35f1 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1 +1,2 @@ +/// /// diff --git a/src/pages/talks/[slug].astro b/src/pages/talks/[slug].astro index aadd7719..b936668a 100644 --- a/src/pages/talks/[slug].astro +++ b/src/pages/talks/[slug].astro @@ -6,22 +6,21 @@ 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"; +import { getCollection } from 'astro:content'; export async function getStaticPaths() { - const talks = await Astro.glob("../../talks/*.md"); + const talks = await getCollection('talk') return talks.map((talk) => { - const slug = getSlugFromFile(talk.file); - return { - params: { slug }, + params: { slug: talk.slug }, props: { talk }, }; }); } -const { Content } = Astro.props.talk; -const { events, speakerdeck, title, video } = Astro.props.talk.frontmatter; +const { Content } = await Astro.props.talk.render(); +const { events, speakerdeck, title, video } = Astro.props.talk.data; --- diff --git a/src/pages/talks/index.astro b/src/pages/talks/index.astro index 157ddcc2..a9416e8c 100644 --- a/src/pages/talks/index.astro +++ b/src/pages/talks/index.astro @@ -1,25 +1,24 @@ --- -import PageLayout from "~/layouts/PageLayout.astro"; -import _ from "lodash"; -import { getSlugFromFile } from "~/utils.ts"; import ListingPage from "~/components/ListingPage.astro"; +import _ from "lodash"; +import { getCollection } from 'astro:content'; -const talks = await Astro.glob("../../talks/*.md"); +const talks = await getCollection('talk'); const talkCount = _(talks) - .flatMap((talk) => talk.frontmatter.events) + .flatMap((talk) => talk.data.events) .size(); const sortedTalks = talks .map((talk) => { - const slug = `/talks/${getSlugFromFile(talk.file)}`; + const slug = `/talks/${talk.slug}` 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], + a.item.data.events[a.item.data.events.length - 1], + b.item.data.events[b.item.data.events.length - 1], ]; return ( diff --git a/tsconfig.json b/tsconfig.json index 0e91d73f..3a34ec41 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "~/*": ["src/*"], - } + "~/*": ["src/*"] + }, + "strictNullChecks": true } }