11---
22import type { ImageMetadata } from " astro" ;
3+ import { getCollection } from " astro:content" ;
34import { Image } from " astro:assets" ;
45import Person1 from " ../placeholders/person-1.astro" ;
56import Person2 from " ../placeholders/person-2.astro" ;
@@ -19,6 +20,7 @@ export interface Props {
1920
2021const {
2122 name,
23+ slug,
2224 tagline,
2325 image,
2426 placeholder,
@@ -30,10 +32,12 @@ const placeholders = [Person1, Person2, Person3, Person4, Person5];
3032const Placeholder =
3133 placeholders [Math .floor (Math .random () * placeholders .length )];
3234
35+ const entries = await getCollection (" speakers" );
36+ const isSpeaker = entries .some ((entry ) => entry .id === slug );
3337---
3438
3539<li class:list ={ [" list-none rounded-2xl overflow-clip flex group" , className ]} >
36- <a class =" block w-full h-full relative " >
40+ <div class =" block w-full h-full relative" >
3741 <div class =" relative aspect-[9/10] overflow-clip" >
3842 {
3943 image ? (
@@ -51,21 +55,30 @@ const Placeholder =
5155 }
5256 </div >
5357
54- <div
55- class =" px-5 py-2 pb-4 bg-keynoter-info rounded-t-none h-full "
56- >
58+ <div class =" px-5 py-2 pb-4 bg-keynoter-info rounded-t-none h-full" >
5759 {
5860 placeholder ? (
59- <p class = " text-body-inverted " >More keynoters coming soon</p >
61+ <p class = " text-body-inverted" >More keynoters coming soon</p >
6062 ) : (
6163 <>
62- <p class = " text-[#17223A] font-bold" >{ name } </p >
63- { tagline ? (
64+ { isSpeaker ? (
65+ <p class = " text-[#17223A] font-bold" >
66+ <a
67+ href = { ` /speaker/${slug } ` }
68+ class = " text-[#17223A] font-bold hover:underline"
69+ >
70+ { name }
71+ </a >
72+ </p >
73+ ) : (
74+ <p class = " text-[#17223A] font-bold" >{ name } </p >
75+ )}
76+ { tagline && (
6477 <p class = " text-secondary-hover text-lg italic" >{ tagline } </p >
65- ) : null }
78+ )}
6679 </>
6780 )
6881 }
6982 </div >
70- </a >
83+ </div >
7184</li >
0 commit comments