Metadata and File Conventions
Pack:
nextjsParent skill: Next.js Metadata, SEO, and File Conventions Source:nextjs/nextjs-metadata-seo-and-file-conventions/references/metadata-and-file-conventions.md
Prefer static exports when possible
Section titled “Prefer static exports when possible”export const metadata:- best for route-stable metadata
generateMetadata(...):- best when metadata depends on params or fetched content
Prefer file conventions for framework-owned outputs
Section titled “Prefer file conventions for framework-owned outputs”app/robots.tsorapp/robots.txtapp/sitemap.tsorapp/sitemap.xmlapp/manifest.tsorapp/manifest.jsonapp/opengraph-image.tsxapp/twitter-image.tsx- icon files and metadata icon conventions
Common heuristics
Section titled “Common heuristics”- Canonical URL logic should be centralized, not rebuilt ad hoc in each route.
- If multiple routes share URL derivation, expose one helper and reuse it.
- Use JSON-LD intentionally and keep it consistent with visible page data.
- Dynamic OG images are runtime work. Avoid making them heavier than the page they represent.