Metadata Files

File-based metadata can be defined by adding special metadata files to route segments.

About

Each file convention can be defined using a static file (e.g. opengraph-image.jpg), or a dynamic variant that uses code to generate the file (e.g. opengraph-image.js). Once a file is defined, Next.js will automatically serve the file (with hashes in production for caching) and update the relevant head elements with the correct metadata, such as the asset's URL, and file type. Find more about Metadata file conventions here: Metadata Files API.

Configuration