# Migration (Astro) — entry point Guidance for migrating an Astro site to CloudCannon. Follow the phases in order. Before starting, run any available audit scripts in [../scripts/](../scripts/) to gather site information automatically. ## Astro scope This guide covers Astro sites that use: - Astro content collections (`src/content/` with `content.config.ts` or `src/content/config.ts`) - `.astro` single-file components - Static output (`output: "static"` -- the default) - Islands architecture with optional framework integrations. `.astro`, React, Vue and Svelte components are supported in editable regions (React, Vue and Svelte need their renderer imported). Solid components throw runtime errors in the visual editor even when nested inside supported components. Convert them to a supported framework, or use `ENV_CLIENT` editing fallbacks (see the `cloudcannon-visual-editing` skill) Server-rendered Astro sites (`output: "server"` or `output: "hybrid"`) are not covered -- CloudCannon requires static output. ## Phases ### Phase 1: Audit Analyze the site before making any changes. Map content collections, routing, components, and the build pipeline. See [audit.md](audit.md). It sends you to [../audit.md](../audit.md) for classifying static pages. ### Phase 2: Configuration Generate a baseline `cloudcannon.config.yml` using the CloudCannon CLI, then customize based on the audit findings. If the site uses MDX components in content, configure snippets as part of this phase. **Read the `cloudcannon-configuration` skill** — its Astro entry point is [cloudcannon-configuration/astro/overview.md](../../cloudcannon-configuration/astro/overview.md). Follow its reading order. If the site uses MDX components or inline HTML in content, also **read the `cloudcannon-snippets` skill**. If the audit's census sends pages to a `pages` collection or page builder, read [../page-building.md](../page-building.md), then [page-building.md](page-building.md). ### Phase 3: Content Review and restructure content files if needed so they work well in the CMS. Read [../content.md](../content.md), then [content.md](content.md) for the Zod schema, `.astro` extraction and `src/assets` images. ### Phase 4: Visual editing Add `@cloudcannon/editable-regions` for inline editing in CloudCannon's Visual Editor. **Read the `cloudcannon-visual-editing` skill** — its Astro entry point is [cloudcannon-visual-editing/astro/overview.md](../../cloudcannon-visual-editing/astro/overview.md). Follow its reading order. ### Phase 5: Build and test Validate the migration works end-to-end with [../build.md](../build.md), then [build.md](build.md) for the Astro cache, bundle and typography checks. Hand off using [handoff.md](../handoff.md) so the user can verify in CloudCannon. ## Notes - Not every site needs all phases. Small sites may skip Phase 3 if content is already well-structured. - Visual editing (Phase 4) is optional but high-value -- prioritize it for sites where the site owner wants a visual editing experience.