Back to docs
Recipe

Bilingual content publisher

Ship every article in two languages with zero friction. Meridian handles the routing, SEO tags, and reader preference so you focus on writing.

What you'll build

A content site where every post exists in English and a second language. Visitors land on the correct version automatically based on their browser's Accept-Language header, with a manual toggle always visible.

Ingredients

  • Next.js App Router with dynamic [lang] segments
  • Middleware that reads Accept-Language and rewrites paths
  • Content stored as Markdown or MDX, one file per language
  • hreflang tags injected per page for search engines

Steps

  1. 1Scaffold the [lang] route group under app/.
  2. 2Write middleware that detects the preferred language and rewrites / to /en or /es.
  3. 3Create a language switcher component that persists the choice in a cookie.
  4. 4Generate alternate links in the document head for every available locale.

Why it matters

Search engines reward properly tagged multilingual sites with higher visibility in regional indexes. Readers stay longer when content appears in their native language. Meridian makes the plumbing invisible so your editorial workflow stays fast.