Prompt to convert a Framer export to Astro

Short answer

This prompt asks an AI coding assistant to rebuild a WebExport copy of a Framer site in Astro. It works from the rendered HTML and CSS instead of the minified script modules, turns repeated sections into components, lists every animation it finds, and ships only the JavaScript each page needs.

Last reviewed

Key facts

  • Framer says a published site cannot be exported as standalone HTML, so the copy is a saved render.
  • Astro pages live in src/pages, and public holds assets that are copied as they are.
  • astro check reports type errors in .astro files and exits with code 1 when it finds any.
  • Test status: Astro steps tested on a real export (Astro 7.4.13), Framer cleanup not yet tested.

The prompt

Paste this into your AI coding assistant with the unzipped export open, and replace the placeholders in square brackets.

Framer to Astro
You are helping me move a static export of a Framer site to Astro.

CONTEXT
- ./exported-site is a WebExport download of my Framer site: HTML, CSS, JavaScript, fonts and images.
- Live site for comparison: [LIVE_URL]. Final domain: [DOMAIN]. Host: [HOST: Vercel, Netlify, Cloudflare Pages, Amazon S3 or Nginx].

TARGET: Astro
- Astro project, one .astro file per page in src/pages with the old paths, one layout in src/layouts, repeated parts as components.
- Assets and untouched scripts go to public/. Delete the scaffold's placeholder src/pages/index.astro before adding the converted home page.
- Output is static, and astro build must write every page to dist/.

FRAMER-SPECIFIC CLEANUP
- Treat the .mjs script modules as read-only. Do not try to edit or convert minified bundles.
- Rebuild sections from the rendered HTML and CSS. Attributes that start with data-framer- are markers, not content.
- List every animation you find, with the section it belongs to, and ask me whether to keep the saved Framer Motion bundle or rebuild it.
- Search for framerusercontent.com in HTML and CSS. Download or replace each hit.

RULES
- Keep the design and every URL path. List path changes in REDIRECTS.md.
- Do not invent content, prices or links. Report gaps in MIGRATION_NOTES.md.
- Build after each step and ask before deleting a script or stylesheet.

START
Inventory the folder, show me a plan, wait for my go-ahead, then convert the home page only.

How to run it

  1. Unzip the download to ./exported-site and create the Astro project beside it.
  2. Paste the prompt, approve the plan, convert the layout and home page, then the rest in small groups.

What to expect from Framer to Astro

Framer pages lean on JavaScript for layout and motion, and Astro is built around shipping less of it. That makes the match interesting: static sections become .astro components with no script, and only the animated ones need client code. The assistant should classify each section as static or animated before it writes anything.

Keep the saved Framer Motion bundles at first and load them only on pages that need them. After the site matches, replace simple effects such as fades and slides with CSS, and keep a script only where the motion is complex.

Questions the assistant should ask you

  • Which pages need JavaScript at all, and which can ship none?
  • Should the saved Framer Motion bundle load only on pages that animate?
  • Do any redirects from Framer settings need to be rebuilt for your host?

Verify the result

Run these from the project folder after each batch. The last command lists files that still refer to Framer.

terminal
npm install
npm install @astrojs/check typescript   # astro check asks for these on first run
npx astro check
npm run build
npx astro preview

# files that still refer to the old platform
grep -rlE "framerusercontent.com" src public | head
  • astro check exits with code 0 and dist holds a page for every old sitemap route.
  • astro preview matches the live site at two widths.
  • Open the network tab and confirm no request goes to framerusercontent.com.
  • Compare the first screen of each page with the live site at phone width.

What can go wrong

  • Converting every component to a client island defeats the point. Ask for scripts only where a section animates.
  • The assistant edits the minified modules. Tell it to treat them as read-only.
  • Fonts load from framerusercontent.com in the saved CSS. The verify step greps for it, and each hit needs a local copy.

Frequently asked questions

Does Astro keep my Framer animations?

Only if you keep the saved bundles or rebuild the effects. The prompt asks the assistant to list the animations first so you can decide for each one.

Do I need a UI framework in Astro?

Not for static sections. Add one only if you want interactive components, and Astro can load it for the sections that need it.

How do I preview the build?

Run astro build, then astro preview to serve the dist folder locally and compare it with the live Framer site.

What about the Framer CMS content?

It is saved as it appeared on the export date. Use the CMS to MDX prompt to move it into content files you can edit.

Official documentation

Free tools for this job

Start with the files

The prompt works on a WebExport download. Paste your public Framer URL into the export form and get a ZIP. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.