To build an event website with Astro, store speakers and sessions as content collections, render a schedule page that shows times in the event’s own timezone, link the ticket button to your ticketing provider, add Event structured data, and generate an .ics calendar file at build time. An event website built with Astro is static, so it stays fast when the ticket announcement goes out and thousands of people open the page at once.
This guide covers the pages a conference, meetup or festival needs and the Astro 7 code behind each one.
Key Takeaways
- Keep ticket sales in a ticketing platform. Your Astro site explains the event and links to checkout.
- Model speakers and sessions as collections, and connect them with
reference()so a speaker’s page lists their talks.- Format every time with an explicit
timeZone, or attendees abroad will see the wrong hour.- Add
EventJSON-LD with dates, location and offers so search engines can show event details.- A static endpoint can generate an
.icsfile, so “add to calendar” works with no server.
What an event website needs
Visitors to an event site arrive with a few questions: what is it, when and where, who is speaking, how much does it cost, and how do I get there. Answer them in that order.
| Page | What it covers |
|---|---|
| Home | Name, date, city or “online”, one-line pitch, ticket button |
| Schedule | Sessions by day and track, with times and rooms |
| Speakers | Grid of speakers, each with a bio page |
| Tickets | Ticket tiers, what’s included, link to checkout |
| Venue | Address, map, travel, accessibility, nearby hotels |
| Sponsors | Sponsor logos and a sponsorship enquiry link |
| FAQ | Refunds, code of conduct, recordings, food |
Put the date and the ticket button above the fold on every page, not only the home page. People share speaker and session links, and those visitors need a path to buy.
Start the project
# Terminal
npm create astro@latest event-site
cd event-site
npx astro add sitemap
npm run dev
Set site in astro.config.mjs to your production domain so canonical URLs and the sitemap are correct. Many events reuse the same site every year, so put the year in content, not in the folder structure: /schedule/ is easier to keep than /2026/schedule/, and you can archive past editions later.
Model speakers and sessions
Speakers and sessions are two collections. Each session references one or more speakers by id, which means a typo in a speaker name fails the build instead of producing a broken link.
// src/content.config.ts
import { defineCollection, reference } from 'astro:content';
import { glob, file } from 'astro/loaders';
import { z } from 'astro/zod';
const speakers = defineCollection({
loader: glob({ pattern: '*.md', base: './src/content/speakers' }),
schema: ({ image }) =>
z.object({
name: z.string(),
role: z.string(),
company: z.string(),
photo: image(),
website: z.string().optional(),
}),
});
const sessions = defineCollection({
loader: file('./src/data/sessions.json'),
schema: z.object({
title: z.string(),
start: z.coerce.date(),
end: z.coerce.date(),
room: z.string(),
track: z.enum(['main', 'workshop', 'community']),
speakers: z.array(reference('speakers')).default([]),
abstract: z.string(),
}),
});
export const collections = { speakers, sessions };
The file() loader reads a JSON array where each object has an id. A schedule is easier to edit as one file than as fifty Markdown files:
[
{
"id": "opening-keynote",
"title": "Opening keynote",
"start": "2027-03-18T09:30:00+01:00",
"end": "2027-03-18T10:15:00+01:00",
"room": "Hall A",
"track": "main",
"speakers": ["ana-lopez"],
"abstract": "Where the web platform is heading this year."
}
]
Write timestamps with an explicit offset (+01:00). That removes any doubt about which timezone a session is in, regardless of where the site is built.
Build a timezone-safe schedule
The most common bug on event sites is wrong session times. The build server usually runs in UTC, so date.toLocaleTimeString() with no options prints UTC times. Always pass the event’s timezone:
// src/lib/time.ts
export const EVENT_TZ = 'Europe/Berlin';
export const formatTime = (date: Date) =>
new Intl.DateTimeFormat('en-GB', {
hour: '2-digit',
minute: '2-digit',
timeZone: EVENT_TZ,
}).format(date);
export const formatDay = (date: Date) =>
new Intl.DateTimeFormat('en-GB', {
weekday: 'long',
day: 'numeric',
month: 'long',
timeZone: EVENT_TZ,
}).format(date);
Then group sessions by day on the schedule page:
---
// src/pages/schedule.astro
import { getCollection, getEntries } from 'astro:content';
import Base from '../layouts/Base.astro';
import { formatDay, formatTime } from '../lib/time';
const sorted = (await getCollection('sessions')).sort(
(a, b) => a.data.start.getTime() - b.data.start.getTime(),
);
const sessions = await Promise.all(
sorted.map(async (s) => ({ ...s, people: await getEntries(s.data.speakers) })),
);
const days = Map.groupBy(sessions, (s) => formatDay(s.data.start));
---
<Base title="Schedule" description="Full conference schedule with times, rooms and speakers.">
<h1>Schedule</h1>
<p>All times are Berlin time (CET).</p>
{[...days].map(([day, items]) => (
<section>
<h2>{day}</h2>
<ol>
{items.map((s) => (
<li id={s.id}>
<time datetime={s.data.start.toISOString()}>{formatTime(s.data.start)}</time>
<strong>{s.data.title}</strong>
<span>{s.data.room}</span>
{s.people.map((p) => <a href={`/speakers/${p.id}/`}>{p.data.name}</a>)}
</li>
))}
</ol>
</section>
))}
</Base>
State the timezone in plain text on the page as well. For an online event, a small <script> can add each visitor’s local time next to the event time, using the same datetime attribute.
Speaker pages
Generate one page per speaker with getStaticPaths(), and list their sessions by filtering on the reference. Speaker pages get shared on social media by the speakers themselves, which is free promotion, so give each one a proper title, description and Open Graph image.
---
// src/pages/speakers/[id].astro
import { getCollection, render } from 'astro:content';
import { Image } from 'astro:assets';
import Base from '../../layouts/Base.astro';
export async function getStaticPaths() {
const speakers = await getCollection('speakers');
return speakers.map((speaker) => ({ params: { id: speaker.id }, props: { speaker } }));
}
const { speaker } = Astro.props;
const { Content } = await render(speaker);
const talks = await getCollection('sessions', ({ data }) =>
data.speakers.some((ref) => ref.id === speaker.id),
);
---
<Base title={`${speaker.data.name} | Speaker`} description={`${speaker.data.name}, ${speaker.data.role} at ${speaker.data.company}.`}>
<Image src={speaker.data.photo} alt={speaker.data.name} width={320} height={320} />
<h1>{speaker.data.name}</h1>
<Content />
<h2>Sessions</h2>
<ul>{talks.map((t) => <li><a href={`/schedule/#${t.id}`}>{t.data.title}</a></li>)}</ul>
<a href="/tickets/">Get your ticket</a>
</Base>
Tickets and registration
Don’t build checkout yourself. Ticketing platforms handle payments, refunds, discount codes, capacity and check-in scanning. Your tickets page should list each tier with what’s included and link to the provider’s checkout, or embed their widget.
If you embed a third-party widget, load it only on the tickets page and only when needed. A <script> with type="module" or a lazy-loaded <iframe loading="lazy"> keeps the rest of the site free of that JavaScript. For free meetups, a simple registration form that posts to a form backend is enough.
Add Event structured data
Event JSON-LD tells search engines the event’s name, dates, location, status and ticket offers. Put it on the home page:
---
// src/components/EventSchema.astro
const schema = {
'@context': 'https://schema.org',
'@type': 'Event',
name: 'Frontend Summit 2027',
startDate: '2027-03-18T09:00:00+01:00',
endDate: '2027-03-19T18:00:00+01:00',
eventStatus: 'https://schema.org/EventScheduled',
eventAttendanceMode: 'https://schema.org/OfflineEventAttendanceMode',
location: {
'@type': 'Place',
name: 'Kulturhaus Mitte',
address: {
'@type': 'PostalAddress',
streetAddress: 'Example Strasse 1',
addressLocality: 'Berlin',
postalCode: '10115',
addressCountry: 'DE',
},
},
offers: {
'@type': 'Offer',
url: 'https://example.com/tickets/',
price: '249',
priceCurrency: 'EUR',
availability: 'https://schema.org/InStock',
},
organizer: { '@type': 'Organization', name: 'Frontend Summit', url: 'https://example.com' },
};
---
<script type="application/ld+json" set:html={JSON.stringify(schema)} />
For an online event, use OnlineEventAttendanceMode and a VirtualLocation with the URL. If the event is postponed or cancelled, update eventStatus rather than deleting the page. More patterns are in the Astro JSON-LD guide, and Google’s event structured data docs list required fields.
Generate an add-to-calendar file
A static endpoint can write an .ics file during the build. Attendees download it and the event lands in their calendar with the right time.
// src/pages/event.ics.ts
import type { APIRoute } from 'astro';
const stamp = (d: Date) => d.toISOString().replace(/[-:]/g, '').replace(/\.\d{3}/, '');
export const GET: APIRoute = () => {
const start = new Date('2027-03-18T09:00:00+01:00');
const end = new Date('2027-03-19T18:00:00+01:00');
const ics = [
'BEGIN:VCALENDAR',
'VERSION:2.0',
'PRODID:-//Frontend Summit//EN',
'BEGIN:VEVENT',
'UID:[email protected]',
`DTSTAMP:${stamp(new Date())}`,
`DTSTART:${stamp(start)}`,
`DTEND:${stamp(end)}`,
'SUMMARY:Frontend Summit 2027',
'LOCATION:Kulturhaus Mitte, Berlin',
'URL:https://example.com/',
'END:VEVENT',
'END:VCALENDAR',
].join('\r\n');
return new Response(ics, { headers: { 'Content-Type': 'text/calendar; charset=utf-8' } });
};
Link it with <a href="/event.ics" download>Add to calendar</a>. Because the times are converted to UTC (the trailing Z), every calendar app shows them correctly in local time. The endpoints docs explain static endpoints further.
Venue, FAQ and after the event
The venue page needs an address, a map link, public transport, parking, step-free access and nearby hotels. Use a static map image linked to a maps provider rather than an embedded map, which loads a lot of JavaScript.
After the event, the site still has value. Add session recordings and slides to each session entry, switch the home page to “see you next year”, and keep the URLs alive. Past speakers and attendees link to them, and that history helps next year’s edition rank.
Deploy and handle launch day
Build with npm run build and deploy dist/ to any static host. Because the pages are plain files on a CDN, a spike from a ticket announcement or a viral tweet doesn’t need any scaling plan. The Cloudflare Pages deploy guide covers the setup.
Start from an event theme
If you’d rather start from a finished design, the Weddings & Events category has conference and event themes. Confy includes speakers, schedule, sponsors, FAQ and ticket pages, Athen suits conferences, summits and workshops, and Codesphere is a tech conference design with schedule and sponsor pages. Free general templates such as AstroWind or Astro’s official starters work too; you’d add the speaker and session collections above. Planning a smaller private event instead? See how to build a wedding website with Astro.
FAQ
Can I sell tickets on a static Astro site?
Yes, by linking to or embedding a ticketing platform. The platform processes payments and manages capacity, while your Astro site describes the event. You don’t need a server or database for this.
How do I show event times in the right timezone in Astro?
Store timestamps with an explicit UTC offset and format them with Intl.DateTimeFormat and the timeZone option set to the event’s timezone. Without timeZone, times are formatted in the build server’s timezone, which is usually UTC.
How do I update the schedule after the site is live?
Edit the sessions JSON file and push. Your host rebuilds the site in a minute or two. If schedule changes come from a CMS, add a build webhook so publishing in the CMS triggers a rebuild.
Does an event website need structured data?
It’s strongly recommended. Event JSON-LD gives search engines the dates, location and ticket details in a format they understand, which can make your event eligible for event features in search results.
What should I do with the event website after the event ends?
Keep it online. Add recordings and slides, mark the event as finished, and announce the next edition on the same domain. Existing links and rankings carry over to next year.