Configure
Configure your site settings.
Goal: Deploy to Netlify in 5 minutes.
Deploy your Astro Swiss Theme site to production in minutes. These deployment instructions work for both the free starter theme and the paid version.
npm run buildThis creates an optimized production build in the dist/ folder.
Before deploying, test your production build:
npm run previewVisit http://localhost:4321 to preview the built site.
The build process:
Output structure:
dist/├── index.html # French homepage (default locale)├── de/│ └──index.html # German homepage├── _astro/ # Bundled CSS and JS├── fonts/ # Font files└── favicon.svgWhy Netlify?
Create netlify.toml in project root:
[build] command = "npm run build" publish = "dist"
[[redirects]] from = "/*" to = "/index.html" status = 200Deploy:
npm install -g netlify-clinetlify deploy --prodVercel auto-detects Astro projects - no configuration file needed:
Or use CLI:
npm i -g vercelvercelVariables prefixed with PUBLIC_ are available in client-side code.
Create .env file:
PUBLIC_SITE_URL=https://yourdomain.comPUBLIC_GA_ID=G-XXXXXXXXXXUse in components:
---const siteUrl = import.meta.env.PUBLIC_SITE_URL;---
<meta property="og:url" content={siteUrl} />Variables without PUBLIC_ prefix are only available server-side.
API_KEY=secret-key-hereDATABASE_URL=postgres://...Add variables in Project Settings → Environment Variables
Add variables in Site Settings → Environment Variables
Add variables in Settings → Environment Variables
Configure
Configure your site settings.
Styling
Customize your site’s appearance.
Support
Get help and support.