Merge pull request 'fix: add missing recommended fields to Event structured data' (#1) from fix/event-structured-data into main

This commit is contained in:
2026-02-24 12:59:09 +01:00

View File

@@ -136,6 +136,8 @@
'script>'
);
const marketUrl = $derived(`https://marktvogt.de/markt/${market.slug}`);
const jsonLdEventHtml = $derived(
'<script type="application/ld+json">' +
JSON.stringify({
@@ -147,10 +149,16 @@
eventAttendanceMode: 'https://schema.org/OfflineEventAttendanceMode',
eventStatus: 'https://schema.org/EventScheduled',
...(market.description ? { description: market.description.slice(0, 500) } : {}),
...(market.image_url ? { image: market.image_url } : {}),
image: market.image_url || 'https://marktvogt.de/apple-touch-icon.png',
...(market.website ? { url: market.website } : {}),
...(market.organizer_name
? { organizer: { '@type': 'Organization', name: market.organizer_name } }
? {
organizer: {
'@type': 'Organization',
name: market.organizer_name,
url: market.website || marketUrl
}
}
: {}),
location: {
'@type': 'Place',
@@ -176,10 +184,21 @@
price: (admission.adult_cents / 100).toFixed(2),
priceCurrency: 'EUR',
availability: 'https://schema.org/InStock',
validFrom: market.start_date
validFrom: market.start_date,
url: market.website || marketUrl
}
}
: {})
: {
isAccessibleForFree: true,
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'EUR',
availability: 'https://schema.org/InStock',
validFrom: market.start_date,
url: market.website || marketUrl
}
})
}) +
'</' +
'script>'