Implements the file-based routing layer for the Astro 6 static site. Each .astro file or subdirectory maps to a URL path segment, producing fully static HTML at build time via getStaticPaths for dynamic routes and direct rendering for static ones. trailingSlash: "always" is enforced at the framework level.
Routes are grouped by feature into subdirectories, each containing index.astro for the listing page and, where applicable, [slug].astro for detail pages. Three content-driven dynamic routes use getStaticPaths to pre-render all entries from content collections. One API endpoint (robots.txt.ts) returns a plain-text response.
Route inventory (15 files, 16 routes):
| Route path | File | Type |
|---|---|---|
/ | src/pages/index.astro | Static |
/produktionen/ | src/pages/produktionen/index.astro | Static |
/produktionen/[slug]/ | src/pages/produktionen/[slug].astro | Dynamic (productions collection) |
/news/ | src/pages/news/index.astro | Static |
/news/[slug]/ | src/pages/news/[slug].astro | Dynamic (news collection) |
/news/abo/ | src/pages/news/abo/index.astro | Static |
/anfahrt/ | src/pages/anfahrt/index.astro | Static |
/impressum/ | src/pages/impressum/index.astro | Static |
/datenschutz/ | src/pages/datenschutz/index.astro | Static |
/faq/ | src/pages/faq/index.astro | Static |
/tickets/ | src/pages/tickets/index.astro | Static |
/mieten/ | src/pages/mieten/index.astro | Static |
/mitwirkende/[slug]/ | src/pages/mitwirkende/[slug].astro | Dynamic (people collection) |
/aboutus/ | src/pages/aboutus/index.astro | Static |
/not-found/ | src/pages/not-found/index.astro | Static (custom 404 page) |
/robots.txt | src/pages/robots.txt.ts | API route (text/plain) |
Dynamic route patterns:
produktionen/[slug].astro — Uses getCollection("productions"), filters out hidden entries (t.data.hidden !== true), and renders each through the MDX Content component with ProductionsLayout injected as a named component. Also loads getCollection("people") to build a peopleById lookup map passed via props.news/[slug].astro — Uses getPublishedNewsEntries() (which wraps getCollection("news") with draft filtering), serves entries in reverse chronological order, and passes previousEntry/nextEntry for pagination links. Renders MDX content with a suite of custom components (NewsImage, NewsSeparator, NewsSplitLayout, NewsText, NewsMaxWidth, NewsButtonLink, ButtonGroup).mitwirkende/[slug].astro — Uses getCollection("people") and getCollection("productions"), derives each person’s participations via buildParticipationsByPerson(), renders MDX with PeopleLayout injected..astro file frontmatter at build time, executes the script block (importing layouts, components, and inline data), and renders the template to a static HTML file at the corresponding directory path (e.g., /produktionen/index.html → served at /produktionen/).getStaticPaths is invoked at build time. It queries content collections via getCollection() / getPublishedNewsEntries(), maps each entry to { params: { slug }, props }, and Astro generates one HTML file per entry. The page script receives Astro.props, renders the MDX Content via await render(entry), and wraps it in a layout.robots.txt.ts exports a GET function that returns a Response with Content-Type: text/plain, dynamically inserting the sitemap URL from the site config.BaseLayout (provides HTML shell, SEO meta, JSON-LD, Google Fonts, analytics bootstrap, and dark-mode safeguard). Production detail routes additionally inject ProductionsLayout as an MDX wrapper component; contributor detail routes inject PeopleLayout. Legal-content pages (impressum, datenschutz) use ContentPageShell for prose spacing./tickets/ → <TicketShopIframe client:load /> (oeticket iframe embed)/news/abo/ → <NewsletterFormBlock client:load /> with <Toaster client:idle />
Both use client:load / client:idle directives; no SSR ISR involved.All routes depend on BaseLayout (@/layouts/BaseLayout.astro) for the outer HTML document. Feature-specific layouts/components are imported per route as shown below.
| Route path | Layouts | Feature components / MDX | Content collections | Notable imports |
|---|---|---|---|---|
/ | BaseLayout | HomeHeroSection, HomeNewsSection, HomeUpcomingShowsSection, AboutUsPromo, HomePressReviewSection | — | buildOrganizationJsonLd |
/produktionen/ | BaseLayout | — | productions (filtered: !hidden) | getProductionDates, normalizeUrl |
/produktionen/[slug]/ | BaseLayout, ProductionsLayout (MDX) | Renders production MDX | productions, people | buildPeopleById, buildBreadcrumbJsonLd, buildProductionEventJsonLd, summarizeForMeta |
/news/ | BaseLayout | — | news (via getPublishedNewsEntries) | buildNewsImage, formatNewsDate, normalizeUrl |
/news/[slug]/ | BaseLayout | NewsImage, NewsSeparator, NewsSplitLayout, NewsText, NewsMaxWidth, NewsButtonLink, ButtonGroup, RichTextContent | news (via getPublishedNewsEntries) | buildBreadcrumbJsonLd, summarizeForMeta, formatNewsDate |
/news/abo/ | BaseLayout | NewsletterFormBlock (React, client:load), Toaster (React, client:idle) | — | sonner/dist/styles.css |
/anfahrt/ | BaseLayout, ContentPageShell | — | — | buildResponsiveImage (gittertor.jpg) |
/impressum/ | BaseLayout, ContentPageShell | — | — | animatedProseTextLinkClassName |
/datenschutz/ | BaseLayout, ContentPageShell | — | — | animatedProseTextLinkClassName |
/faq/ | BaseLayout | FaqContent (MDX from @/features/pages/faq/) | — | — |
/tickets/ | BaseLayout (overridden classes) | TicketShopIframe (React, client:load) | — | — |
/mieten/ | BaseLayout, ContentPageShell | ImageTextSection, RichTextContent | — | buildResponsiveImage (4 images from assets) |
/mitwirkende/[slug]/ | BaseLayout, PeopleLayout (MDX) | Renders person MDX | people, productions | buildParticipationsByPerson, buildPeopleLayoutContext |
/aboutus/ | BaseLayout, ContentPageShell | — | — | — |
/not-found/ | BaseLayout | — | — | normalizeUrl |
/robots.txt | — (API route) | — | — | APIRoute type |
Content collections (defined in src/content.config.ts):
productions — MDX, schema includes title, hidden, promotion, dates (discriminated union: hidden/range/multiRange/distinct), duration, logo, summary, images, participants (with people references), sponsors (references), songlist, legacyShowId, pressFiles, pressImages.news — MDX, schema includes title, description, date, heroImage, heroImageAlt, draft.people — MDX, schema includes firstName, lastName, profileImage. Used by productions via reference("people").sponsors — YAML, schema includes title, url, logoType, logo. Referenced by productions.