Code snippets
Tools → Snippets is a built-in library of copy-paste Astro code. Snippets are generated dynamically — form URLs use your admin origin, collection examples use the real names from your pod, and the ticket-button snippet only appears when an events collection exists.
Where to find it
Go to Tools → Snippets in the admin sidebar (or press g p in Space Station mode). Click any card to expand it, then hit Copy to copy the code to clipboard.
Available snippets
| Category | Snippet | Description |
|---|---|---|
| Setup | Integration — astro.config.mjs | Add orbiter-integration to your Astro project |
| Content | getCollection | Fetch all published entries from a collection at build time |
| Content | Dynamic page — [slug].astro | Generate one static page per entry |
| Content | Image from media library | Render a media-library image field |
| SEO | SEO <head> — meta + OG | Full head block with meta title, description, and Open Graph |
| Forms | Contact form | HTML + JS for a contact form with honeypot |
| Forms | Booking / Terminanfrage | Booking form with date, time, persons fields |
| Events | Ticket-Button | Pretix / Eventbrite / Eventim ticket link with price display (only shown when an events collection exists) |
| Integration | RSS Feed link | <link rel="alternate"> for the auto-generated feed |
| Integration | Sitemap | robots.txt Sitemap directive for Google Search Console |
| Integration | JSON API fetch | Client-side runtime fetch without a build step |
Dynamic values
The following are substituted automatically when the page loads:
- Collection name — uses the first content collection found in the pod (blog, posts, articles, news — or the first one defined)
- Admin origin — form action URLs use
window.location.origin, so they point to your actual admin host - Events collection — the ticket-button snippet only renders if your pod has a collection with ID
events
Filter by category
Use the filter bar at the top (All / Setup / Content / SEO / Forms / Events / Integration) to show only the snippets relevant to your current task.