-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
structuredDataSample.js
49 lines (48 loc) · 1.87 KB
/
structuredDataSample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
"@context": "https://schema.org",
"@type": "Event",
"name": "${event?.title}",
"description": "${`${localization['when']}: ${localWhen}, ${localization['country']}: ${country}, ${localization['city']}: ${event?.city}, ${localization['artists']}: ${artists}`}",
"image": "${event?.image?.url}",
"startDate": "${event?.date}",
"endDate": "${event?.end}",
"eventStatus": "${eventStatusSchema[event?.status] || 'https://schema.org/EventScheduled'}",
"eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
"location": {
"@type": "Place",
"name": "${event?.venue}",
"address": {
"@type": "PostalAddress",
"streetAddress": "${event?.street}",
"addressLocality": "${event?.city}",
"postalCode": "${event?.postalCode}",
"addressCountry": "${event?.country}"
}
},
"organizer": {
"@type": "Organization",
"name": "DreamPip",
"url": "https://www.dreampip.com"
},
"performer": [
${ event?.artistsCollection?.items?.map((artist) => {
return `
{
"@type": "Person",
"name": "${artist?.name}"
}
`
}).join(',')}]
${
(event?.ticketsSchema ||
event?.ticketsSchema2 ||
event?.ticketsSchema3 ||
event?.ticketsSchema4) ? `,
"offers": [
${JSON.stringify(event?.ticketsSchema?.offers || {})},
${event?.ticketsSchema2 ? JSON.stringify(event?.ticketsSchema2?.offers || {}) + ',' : ','}
${event?.ticketsSchema3 ? JSON.stringify(event?.ticketsSchema3?.offers || {}) + ',' : ','}
${event?.ticketsSchema4 ? JSON.stringify(event?.ticketsSchema4?.offers || {}) + '' : ''}
]
` : ``
}