Metadata API
واجهة Metadata في Next.js
Definition
Next.js App Router's built-in system for defining page title, description, and Open Graph tags via exports.
نظام Next.js App Router المدمج لتعريف عنوان الصفحة والوصف وعلامات Open Graph عبر التصديرات.
Why It Matters
All 404Fault SEO metadata is defined via the Metadata API. Glossary term pages have dynamic metadata generated per-term from Firestore. Layout files handle metadata for client pages.
كل بيانات SEO في 404Fault مُعرَّفة عبر Metadata API. صفحات مصطلحات القاموس لديها metadata ديناميكية مُولَّدة لكل مصطلح من Firestore. ملفات التخطيط تتعامل مع metadata لصفحات العميل.
Full Definition
Example Usage
“export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> { const { slug } = await params; const term = await fetchTerm(slug); return { title: `${term.nameEn} — AI Glossary | 404fault`, description: term.shortDefinitionEn }; }”
“export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> { const { slug } = await params; const term = await fetchTerm(slug); return { title: `${term.nameEn} — AI Glossary | 404fault`, description: term.shortDefinitionEn }; }”
AI Builder Tips
Avoid these mistakes when using Metadata API:
Exporting metadata from a 'use client' component — it's silently ignored
Not providing twitter: card in addition to openGraph — Twitter uses its own tags
Sign in to unlock guided AI explanations from AI Teacher.
Generate a Prompt
Copy this prompt and use it directly with any AI model — no setup needed.
Help me build a project using Metadata API. Explain: 1. What is Metadata API and why it matters 2. The core architecture and required tools 3. Step-by-step implementation plan 4. Common mistakes to avoid: Exporting metadata from a 'use client' component — it's silently ignored, Not providing twitter: card in addition to openGraph — Twitter uses its own tags 5. Best practices and production tips