Export a metadata object from any layout or page. The framework merges nested layouts' metadata, with the page taking precedence. Title templates compose: %s | My App.
Dynamic metadata
Export an asyncgenerateMetadata({ params }) for routes whose tags depend on data (blog post title, product name, user page).
Open Graph images, generated server-side
Drop an opengraph-image.tsx in any segment and Next.js renders it via Vercel's Satori-based ImageResponse. No design tool, no preflight; you author OG images as React JSX.
Put stable defaults in layout metadata and generate only route-specific fields in generateMetadata. Use one canonical URL policy, absolute social-image URLs, and metadata that reflects the same authorization and not-found decisions as the page data. Metadata is part of the rendered route contract, not a detached SEO object. Fetching the same record independently can duplicate work or disagree with the page, and a beautiful Open Graph card cannot rescue an incorrect canonical or private page indexed publicly.
Inspect source HTML for title, description, canonical, robots, and social tags on a normal route, nested route, missing record, and restricted record. Render the Open Graph image at its declared size and run a sharing-card validator.
Add a title template at the root layout, dynamic metadata to one blog page, and an opengraph-image.tsx for the same route. Test the OG card with the Twitter Card validator.
Progress
Progress is local-only — sign in to sync across devices.