From 3e0d8a1cc7c8f9aebc4a5ed88dc90aa43a843879 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 21 May 2019 00:04:24 +0100 Subject: [PATCH] Order speakers --- app/config/sculpin_kernel.yml | 2 +- source/_includes/front-speakers.html.twig | 2 +- source/_speakers/{dan-mcnamara.md => 1-dan-mcnamara.md} | 2 +- source/_speakers/{matt-haworth.md => 2-matt-haworth.md} | 2 +- .../_speakers/{daniel-pickering.md => 3-daniel-pickering.md} | 2 +- src/Speakers/src/TwigExtension/SpeakersExtension.php | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) rename source/_speakers/{dan-mcnamara.md => 1-dan-mcnamara.md} (95%) rename source/_speakers/{matt-haworth.md => 2-matt-haworth.md} (85%) rename source/_speakers/{daniel-pickering.md => 3-daniel-pickering.md} (86%) diff --git a/app/config/sculpin_kernel.yml b/app/config/sculpin_kernel.yml index 30c0b87..1028c81 100644 --- a/app/config/sculpin_kernel.yml +++ b/app/config/sculpin_kernel.yml @@ -2,6 +2,6 @@ sculpin_content_types: sessions: permalink: /sessions/:basename/ speakers: - permalink: /speakers/:basename/ + permalink: /speakers/:title/ posts: enabled: false diff --git a/source/_includes/front-speakers.html.twig b/source/_includes/front-speakers.html.twig index 9275295..b6e4d32 100644 --- a/source/_includes/front-speakers.html.twig +++ b/source/_includes/front-speakers.html.twig @@ -7,7 +7,7 @@
  • - {{ speaker.name }} + {{ speaker.title }} {% include 'speaker-role' with { speaker: speaker } %} diff --git a/source/_speakers/dan-mcnamara.md b/source/_speakers/1-dan-mcnamara.md similarity index 95% rename from source/_speakers/dan-mcnamara.md rename to source/_speakers/1-dan-mcnamara.md index 66fb4e1..925bf68 100644 --- a/source/_speakers/dan-mcnamara.md +++ b/source/_speakers/1-dan-mcnamara.md @@ -1,5 +1,5 @@ --- -name: Dan McNamara +title: Dan McNamara role: Managing Director organisation: Microserve image: dan-mcnamara.jpg diff --git a/source/_speakers/matt-haworth.md b/source/_speakers/2-matt-haworth.md similarity index 85% rename from source/_speakers/matt-haworth.md rename to source/_speakers/2-matt-haworth.md index 03a9b8a..2ff67da 100644 --- a/source/_speakers/matt-haworth.md +++ b/source/_speakers/2-matt-haworth.md @@ -1,5 +1,5 @@ --- -name: Matt Haworth +title: Matt Haworth role: Co-Founder organisation: Reason Digital image: matt-haworth.jpg diff --git a/source/_speakers/daniel-pickering.md b/source/_speakers/3-daniel-pickering.md similarity index 86% rename from source/_speakers/daniel-pickering.md rename to source/_speakers/3-daniel-pickering.md index af403da..acab547 100644 --- a/source/_speakers/daniel-pickering.md +++ b/source/_speakers/3-daniel-pickering.md @@ -1,5 +1,5 @@ --- -name: Daniel Pickering +title: Daniel Pickering role: Full Stack Developer organisation: Annertech image: daniel-pickering.jpg diff --git a/src/Speakers/src/TwigExtension/SpeakersExtension.php b/src/Speakers/src/TwigExtension/SpeakersExtension.php index be75c02..4492830 100644 --- a/src/Speakers/src/TwigExtension/SpeakersExtension.php +++ b/src/Speakers/src/TwigExtension/SpeakersExtension.php @@ -29,7 +29,7 @@ class SpeakersExtension extends AbstractExtension public function getSessionSpeakers($session, array $speakers): array { return collect($speakers)->filter(function ($speaker) use ($session): bool { - return collect($session['speakers'])->contains($speaker['name']); + return collect($session['speakers'])->contains($speaker['title']); })->values()->toArray(); } @@ -44,7 +44,7 @@ class SpeakersExtension extends AbstractExtension public function getSpeakerSessions($speaker, array $sessions): array { return collect($sessions)->filter(function ($session) use ($speaker): bool { - return collect($session['speakers'])->contains($speaker['name']); + return collect($session['speakers'])->contains($speaker['title']); })->values()->toArray(); } } \ No newline at end of file