When you run a transfer service that publishes fixed prices across 633 static pages in 8 languages, pricing changes are not a database update — they are a build.
The Problem
Our site navetteforyou.com serves Marrakech airport transfers and day trips. Every route has a price in MAD (Moroccan Dirhams) that appears on multiple pages across 8 language variants. Change one price, and it propagates to dozens of pages.
We needed:
- A single source of truth for all prices
- Automatic propagation to every language/page combo
- A validation gate that catches any price anomaly before deploy
- No price under our 600 MAD floor appearing anywhere
The Architecture
// src/content/pricing.ts — single source of truth
export const ROUTES = {
'marrakech-airport': { mad: 300, category: 'airport' },
'marrakech-essaouira': { mad: 1800, category: 'day-trip' },
'marrakech-fes': { mad: 3500, category: 'intercity' },
// ... 89 routes
} as const;
Each route price lives in one place. Astro's static site generation reads this at build time and stamps it onto every page that references that route.
The Validation Gate
Before every deploy, a TypeScript script scans every generated HTML file:
// scripts/static-price-check.ts
const files = glob.sync('dist/**/*.html');
for (const file of files) {
const html = readFileSync(file, 'utf8');
const prices = html.match(/\d+\s*MAD/g) || [];
for (const p of prices) {
const val = parseInt(p);
if (val > 0 && val < 600) {
errors.push(`${file}: found ${p} below 600 MAD floor`);
}
}
}
This runs in CI. If any page shows a price below our business floor, the deploy fails. No exceptions.
Lessons
- Static sites make pricing auditable. Every price on every page is in the HTML at build time. No runtime surprises.
- A validation gate is cheaper than a mistake. One wrong price on one page can cost real money. The 30-second check is worth it.
- Single source of truth scales. 633 pages, 8 languages, 89 routes — and a price change is still a one-line edit.
Operated by Serenity Morocco Tours. Visit navetteforyou.com or WhatsApp +212 701 664 704.
Top comments (0)