astro-structured-datav2.0.1

← All examples

Online event

With attendanceMode="Online" the stream URL is output as a VirtualLocation, as Google requires.

Online event

examples/online-event.astro
---
import { EventSchema } from '@casoon/astro-structured-data/components';
---

<!-- Online event: no venue, the stream URL becomes a VirtualLocation. -->
<EventSchema
  name="Astro Live Webinar"
  description="Structured data in Astro, live with Q&A."
  startDate="2026-10-20T17:00:00+02:00"
  endDate="2026-10-20T18:30:00+02:00"
  attendanceMode="Online"
  onlineUrl="https://example.com/live"
  organizer={{ name: 'Example GmbH', url: 'https://example.com' }}
  price={0}
  priceCurrency="EUR"
/>
{
  "@context": "https://schema.org",
  "@type": "Event",
  "name": "Astro Live Webinar",
  "startDate": "2026-10-20T17:00:00+02:00",
  "endDate": "2026-10-20T18:30:00+02:00",
  "description": "Structured data in Astro, live with Q&A.",
  "eventAttendanceMode": "https://schema.org/OnlineEventAttendanceMode",
  "eventStatus": "https://schema.org/EventScheduled",
  "location": {
    "@type": "VirtualLocation",
    "url": "https://example.com/live"
  },
  "offers": {
    "@type": "Offer",
    "price": 0,
    "priceCurrency": "EUR",
    "availability": "https://schema.org/InStock",
    "url": "https://example.com/"
  },
  "organizer": {
    "@type": "Organization",
    "name": "Example GmbH",
    "url": "https://example.com"
  }
}
  • Event
  • VirtualLocation
  • EventSchema