The App Router `metadata` and `generateMetadata` exports give you type-safe defaults, per-route overrides, and canonical alternates without shipping duplicated `<head>` snippets across layouts.

  • Set `metadataBase` once in root layout for absolute OG and Twitter image URLs.
  • Define `openGraph` and `twitter` together; keep image aspect ratios predictable (e.g. 1200×630).
  • Use `robots` and `alternates.canonical` for staging vs production parity checks in CI.

Pair route metadata with JSON-LD added via a small component or stream so search and AI crawlers see consistent entity signals.