Skip to content
Documentation
Browse docs
guide

Build and preview an Astro site

Build and preview an Astro website from the official Answer Cloud template, preserve editable source, and package compiled output with the correct public origin.

Reviewed

The official Answer Cloud template provides an Astro starting point for standalone hosted websites. Astro source gives your agent a repeatable way to edit pages and rebuild the complete static artifact.

For a first public launch, let your agent follow the current launch guide. The commands below explain the local source workflow; they do not replace that guide's account and publication process.

Create the project#

Use a Node.js and npm runtime compatible with the template's actual package requirements:

npm create astro@latest -- --template answer-cloud/answer_cloud_template my-site
cd my-site
npm install
npm run build

The source repository is answer-cloud/answer_cloud_template. Inspect its package scripts and configuration rather than assuming that every checkout uses the same Node version or output command.

The unassigned template can be compiled before you reserve a public address. After a site is reserved, configure its public origin as instructed by the template. The current standalone launch uses SITE_URL with the reserved HTTPS URL and npm run build:site; preserve the scripts supplied by the current template.

Edit the source#

Put public page source in src/pages/, reusable structures in components and layouts, and public static assets in public/. Keep Astro configured for static output.

Replace sample content with accurate information from the website brief. Choose a consistent palette, typography, imagery, and primary visitor action. Important information should appear in the initial HTML, with usable links and headings even when JavaScript is unavailable.

Do not add hand-written copies of the deployment-generated discovery files, analytics, or hosted chat embed. Keep any site-specific chat theme in a scoped stylesheet, following chat appearance guidance.

Preview the build#

Use the project's development script while editing, then compile the site and use its preview script when present:

npm run dev
npm run build
npm run preview

Check the generated pages at desktop and mobile sizes. Follow internal links and inspect images. Verify keyboard use, visible focus, and reduced-motion behavior when animations exist. A working development server alone does not prove the production build is complete.

Preserve and package separately#

Retain the editable Astro project for future sessions. A clean source archive includes pages, components, configuration, package files, lockfile, and assets; exclude credentials, environment files, dependencies, and private launch responses.

For deployment, package the contents of the compiled output directory so index.html is at the ZIP root. Include a site-specific social preview image and any CMS manifest/private templates your project requires. The source archive and deployment ZIP serve different purposes. Follow Deploy a ZIP to publish the build.

Have a question about this guide?

Send feedback

Type to find a guide.