Prompt to convert a Webflow export to Astro

Short answer

This prompt asks an AI coding assistant to move a WebExport copy of a Webflow site into an Astro project. Each page becomes a file in src/pages, shared header and footer become components, assets go to public, and webflow.js stays until you rebuild its interactions. Astro outputs plain static files, which suits a Webflow export.

Last reviewed

Key facts

  • Astro turns each file in src/pages into a route, including .astro, .md, .mdx and .html files.
  • Files in public are copied to the build untouched, which fits the exported assets folder.
  • astro build writes static files to dist, ready for any static host.
  • Test status: Astro steps tested on a real export (Astro 7.4.13), Webflow 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.

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

CONTEXT
- ./exported-site is a WebExport download of my Webflow 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/.

WEBFLOW-SPECIFIC CLEANUP
- Keep webflow.js and the data-w-id attributes until each interaction has been rebuilt. List every interaction first and ask me whether to keep or rebuild it.
- Keep classes with a w- prefix (w-nav, w-dropdown, w-tab, w-slider, w-form). Webflow scripts control them.
- Forms: keep the fields and labels, set the action to [FORM_ENDPOINT], and report any form you could not convert.
- Search for website-files.com in HTML, CSS, inline styles and Lottie data-src values. 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 Webflow to Astro

Astro suits this move because it ships no JavaScript framework by default, and a Webflow export is already finished HTML. The assistant can wrap each page in a base layout, lift the repeated navbar and footer into components and leave the rest of the markup alone. The saved CSS keeps working because the class names do not change.

Webflow’s CMS pages are the natural place to use Astro content collections. Convert the static pages first. Then use the CMS to MDX prompt to turn the item pages into content files, so new posts are a markdown file instead of a re-export.

Questions the assistant should ask you

  • Should webflow.js load on every page or only on pages that use interactions?
  • Should blog posts move into a content collection in this pass?
  • Which host will serve the dist folder, so that redirects are written for it?

Verify the result

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

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 "website-files.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.
  • Submit each form once and confirm the message arrives where you expect.
  • Scroll every page with the console open and confirm no animation script returns 404.

What can go wrong

  • The assistant moves scripts into a bundler step and breaks the load order that webflow.js expects. Keep Webflow scripts as plain script tags at the end of the layout.
  • Duplicate head tags when a page and the layout both set a title or canonical. Ask for one place to set them.
  • Forms still point at Webflow. The prompt replaces them, and a real submission is the only test that counts.

Frequently asked questions

Why choose Astro over Next.js for a Webflow export?

Astro builds static files without a client framework, so the output is close to what you exported. Next.js adds a React runtime, which helps if you plan to add app features.

Where do the exported CSS and images go?

Put the stylesheet in src or public, and the images and fonts in public. Astro copies public files to the build as they are.

Can I keep Webflow Interactions?

Yes, by keeping webflow.js and the data attributes it reads. List each interaction first, then decide which to rebuild with CSS.

Which host works best for the Astro output?

Any static host. The Webflow on Netlify guide covers redirects, headers and forms.

Official documentation

Free tools for this job

Start with the files

The prompt works on a WebExport download. Paste your public Webflow 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.