A Static Page for Every Place
Generate one fast, cacheable page per destination and per language at build time — and why a tour guide's site needs no server at all.
Lesson 2 of 10 · Tourism Tech · built from Nora Travels, Nora Labs, Mahesh Travellers and my hospitality sites
Travellers browse from another continent on hotel Wi-Fi. The fastest page is one that already exists as a file. Both tourism sites generate every page at build time.
Example — one page per destination
// app/destinations/[slug]/page.tsx
export async function generateStaticParams() {
const destinations = getAllDestinations();
return destinations.map((d) => ({ slug: d.slug }));
}Example — one page per language (Mahesh Travellers)
// app/[locale]/page.jsx
export const dynamicParams = false;
export function generateStaticParams() {
return Object.keys(content.copy).map((locale) => ({ locale }));
}
export async function generateMetadata({ params }) {
const { locale } = await params;
const c = content.copy[locale];
if (!c) return {};
return { title: `Mahesh Travellers · ${locale.toUpperCase()} · Sri Lanka`, description: c.heroDesc };
}dynamicParams = falsemeans an unknown locale is a 404, never a slow on-demand render.generateMetadatagives every language its own title and description for search engines.- The production build lands in
out/— plain files any static host or CDN can serve.
Try it yourself: visit the live Mahesh Travellers site and switch languages — each is a separate prebuilt page.
Exercise
You add a Tamil translation. What is the only place you need to add data for the /ta/ page to be generated?
Keep going: ← Lesson 1 · Lesson 3 →
ExerciseKnowledge check
Why is Mahesh Travellers exported as fully static HTML?
Finished this one?
Progress is saved in this browser.
Projects in this lesson

AI Agents
Nora Labs
Tourthon 2026 AI-driven multi-agent platform for bespoke Sri Lankan travel itineraries, live driver dispatch, and instant dynamic booking.

Client Web
Mahesh Travellers
Next.js dynamic tourism booking portal showcasing bespoke Sri Lankan tour packages, Ella hiking, cultural heritage, and private driver services.


