MCPcopy Create free account
hub / github.com/api-platform/website / getTalkSubEventData

Function getTalkSubEventData

pwa/utils/con/index.tsx:154–186  ·  view source on GitHub ↗

* schema.org structured data for a single talk, modeled as a nested `Event` * (no `@context` — it is embedded as a `subEvent` of the edition's conference).

(conference: Conference, rootUrl: string)

Source from the content-addressed store, hash-verified

152 * (no `@context` — it is embedded as a `subEvent` of the edition's conference).
153 */
154function getTalkSubEventData(conference: Conference, rootUrl: string) {
155 const { date, start, end, title } = conference;
156
157 const description = (conference.short || conference.description || "")
158 .replace(/<[^>]*>/g, "")
159 .replace(/\s+/g, " ")
160 .trim();
161
162 const talkUrl = conference.url ? `${rootUrl}${conference.url}` : undefined;
163
164 return {
165 "@type": "Event",
166 name: title,
167 ...(description ? { description } : {}),
168 ...(date && start ? { startDate: `${date}T${start}:00` } : {}),
169 ...(date && end ? { endDate: `${date}T${end}:00` } : {}),
170 eventStatus: "https://schema.org/EventScheduled",
171 eventAttendanceMode: "https://schema.org/OfflineEventAttendanceMode",
172 location: CONF_PLACE,
173 ...(talkUrl ? { url: talkUrl } : {}),
174 ...(conference.speakers?.length
175 ? {
176 performer: conference.speakers.map((speaker) => ({
177 "@type": "Person",
178 name: speaker.name,
179 ...(speaker.job ? { jobTitle: speaker.job } : {}),
180 ...(speaker.image ? { image: `${rootUrl}${speaker.image}` } : {}),
181 ...(speaker.url ? { url: `${rootUrl}${speaker.url}` } : {}),
182 })),
183 }
184 : {}),
185 };
186}

Callers 1

getEditionEventDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected