( edition: string, speakers: Speaker[] = [], talks: Conference[] = [] )
| 97 | }; |
| 98 | |
| 99 | export function getEditionEventData( |
| 100 | edition: string, |
| 101 | speakers: Speaker[] = [], |
| 102 | talks: Conference[] = [] |
| 103 | ) { |
| 104 | const currentEdition = editions.find((e) => e.year === edition); |
| 105 | const rootUrl = getRootUrl(); |
| 106 | |
| 107 | const eventData = { |
| 108 | "@context": "https://schema.org", |
| 109 | "@type": "Event", |
| 110 | name: `API Platform Conference ${edition}`, |
| 111 | description: |
| 112 | "The international conference dedicated to API Platform and its ecosystem", |
| 113 | url: `https://api-platform.com/con/${edition}/`, |
| 114 | eventStatus: "http://schema.org/EventScheduled", |
| 115 | eventAttendanceMode: "https://schema.org/MixedEventAttendanceMode", |
| 116 | startDate: currentEdition?.startDate, |
| 117 | endDate: currentEdition?.endDate, |
| 118 | organizer: { |
| 119 | "@type": "Organization", |
| 120 | name: "Les-Tilleuls.coop", |
| 121 | url: "https://les-tilleuls.coop/en", |
| 122 | }, |
| 123 | location: [ |
| 124 | CONF_PLACE, |
| 125 | { |
| 126 | "@type": "VirtualLocation", |
| 127 | url: `https://api-platform.com/con/${edition}/`, |
| 128 | }, |
| 129 | ], |
| 130 | image: `${getRootUrl()}/images/con/og-${edition}`, |
| 131 | ...(speakers.length |
| 132 | ? { |
| 133 | performer: speakers.map((speaker) => ({ |
| 134 | "@type": "Person", |
| 135 | name: speaker.name, |
| 136 | ...(speaker.job ? { jobTitle: speaker.job } : {}), |
| 137 | image: `${rootUrl}${speaker.image}`, |
| 138 | url: `${rootUrl}${speaker.url}`, |
| 139 | })), |
| 140 | } |
| 141 | : {}), |
| 142 | ...(talks.length |
| 143 | ? { subEvent: talks.map((talk) => getTalkSubEventData(talk, rootUrl)) } |
| 144 | : {}), |
| 145 | }; |
| 146 | |
| 147 | return eventData; |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * schema.org structured data for a single talk, modeled as a nested `Event` |
no test coverage detected