Prompt to convert a Squarespace export to Astro
This prompt asks an AI coding assistant to move a WebExport copy of a Squarespace site into an Astro project. Pages become files in src/pages, galleries become components, blog posts move into a content collection, and form and store blocks are replaced. It records every URL change in a redirects list.
Last reviewed
Key facts
- Astro content collections are defined in src/content.config.ts with a loader and an optional schema.
- Squarespace’s own export is an XML file for importing into other platforms.
- Blog posts are the best fit for a collection, since each is a content file with a date and a title.
- Test status: Astro steps tested on a real export (Astro 7.4.13), Squarespace 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.
You are helping me move a static export of a Squarespace site to Astro.
CONTEXT
- ./exported-site is a WebExport download of my Squarespace 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/.
SQUARESPACE-SPECIFIC CLEANUP
- Classes with an sqs- prefix come from Squarespace blocks. Keep markup and classes together when you convert a block.
- Convert each gallery as one unit, markup and script together, and test it at phone width.
- Replace form, newsletter and store blocks. Link store pages to [STORE_URL].
- Search for squarespace-cdn.com and static1.squarespace.com. Download or replace each hit.
- If blog URLs contain dates, keep the same paths or list each change in REDIRECTS.md.
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
- Unzip the download to ./exported-site and create the Astro project beside it.
- Paste the prompt, approve the plan, convert the layout and home page, then the rest in small groups.
What to expect from Squarespace to Astro
Squarespace sites tend to be a few pages plus a blog or a portfolio, which maps well onto Astro: pages for the fixed content and a collection for posts. The assistant reads the saved blog pages, extracts title, date and body into markdown files and builds one template that renders them all. That is the step that makes future posts a file instead of a re-export.
Check dates carefully. If your old URLs contain year, month and day, the template route has to keep the same shape, or the assistant has to record each change as a redirect.
Questions the assistant should ask you
- Which pages are blog posts, and which are fixed pages?
- What should replace the newsletter and contact blocks?
- Should each gallery become a component with its own script, or stay as exported?
Verify the result
Run these from the project folder after each batch. The last command lists files that still refer to Squarespace.
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 "squarespace-cdn.com|static1.squarespace.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 one dated blog URL from the old sitemap and confirm it answers with the right page or a 301.
- Test each gallery at a phone-width window.
What can go wrong
- The assistant rewrites post text while converting it to markdown. Tell it to keep the words exactly and flag anything it cannot parse.
- Gallery scripts depend on Squarespace’s markup. Convert the gallery as one unit and test it on a phone.
- Newsletter and contact blocks still post to Squarespace until you give them a new endpoint.
Frequently asked questions
Is a content collection necessary?
No, but it makes new posts a markdown file. Without it you export again after every change.
Where do the Squarespace images go?
Into public or src/assets. The WebExport copy already has local paths, so the assistant mostly moves files and updates references.
How do I keep dated blog URLs?
Use a dynamic route that includes the date segments, or redirect old paths to new ones. The Squarespace on Vercel guide has a one-line pattern for the redirect.
Will the Astro build be smaller than the export?
It depends on your images and scripts. Run astro build and compare the dist folder with the exported one before you decide.
Official documentation
Free tools for this job
- Squarespace Exit PlannerStep-by-step guide and checklist generator for leaving Squarespace.
- No-Code Lock-in ScoreAnalyze any platform and get a portability score with data export options.
- No-Code Asset Path NormalizerRewrite CDN URLs to local relative paths for offline and self-hosted deployments.
- Redirect Map BuilderBuild an old-to-final redirect mapping from URL lists.
Start with the files
The prompt works on a WebExport download. Paste your public Squarespace 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.