astro.config.mjs controls the framework, adapters, integrations, routing and redirects; src/config/site.ts centralises every SEO token and business detail that feeds structured data; and src/config.ts holds the WhatsApp deep-link utility consumed by all four language variants of the site. Keeping these three files in sync is the first step before going live or after any rebrand.
astro.config.mjs
The root framework config. It declares the deployment target, trailing-slash policy, 301 redirects, all integrations, and the i18n routing strategy.
astro.config.mjs
site
adapter
@astrojs/netlify (^7.0.12). All pages are statically prerendered except the Keystatic admin routes, which require SSR. The adapter wraps those in Netlify Functions automatically with no extra configuration.
trailingSlash
/es/tallers not /es/tallers/). The Netlify adapter enforces this at the edge.
redirects
All redirects are declarative 301s in the Astro config. They fall into two groups:
Legacy /ca/* → /* — Catalan is the default locale served at root (no /ca/ prefix). Any legacy URLs with the /ca prefix get permanently redirected to strip it.
/<lang>/blog → /blog — The blog is intentionally Catalan-only. Non-Catalan blog URLs redirect to the Catalan blog so shared links and old bookmarks still resolve.
Astro requires redirect destinations to match real routes. Wildcards like
/ca/* do not work in Astro’s redirects object — each sub-route must be listed explicitly.integrations
i18n
src/config/site.ts
This file exports the SITE constant — a single object that every SEO and structured-data component reads from. It is the single source of truth for the business name, address, contact details, hours, and social links.
Type definitions
The SITE export
src/config/site.ts
Key fields
src/config.ts
A minimal module that exposes the WhatsApp contact number and the waHref URL builder.
src/config.ts
waHref(text)
Builds a WhatsApp deep link with a pre-filled message. Every CTA button and the floating WhatsApp FAB call waHref() with a locale-specific message string fetched from src/i18n/ui.ts. The resulting URL opens the WhatsApp app (or web) with the message pre-composed, ready to send.
Example:
Environment variables
No.env file is required. All project configuration is in code. Keystatic Cloud credentials (used for authenticating the /keystatic admin in production) are configured through the Keystatic Cloud dashboard and injected by Netlify at build/runtime — they are never stored locally.
Node version
The project requires Node ≥ 22.12.0, declared inpackage.json and pinned in netlify.toml:
netlify.toml
.npmrc
.npmrc
legacy-peer-deps=true is required to resolve a peer dependency conflict between @keystatic/astro 5.0.6 and Astro 6. Without it, npm install exits with an ERESOLVE error. Do not remove this flag until the upstream conflict is resolved in a future Keystatic release.