SEO
Metadata
How to customize the page metadata.
Metadata is handled through Next.js's built-in Metadata API. @repo/seo wraps it in a createMetadata function that fills in the defaults every page shares:
import { createMetadata } from '@repo/seo/metadata';
export const metadata = createMetadata({
title: 'My Page',
description: 'My page description',
});While this looks similar to just exporting a metadata object from your page, the createMetadata function deep merges your metadata with our default metadata, allowing you to customize only the metadata that you need to. It's also much easier to specify a cover photo for the page, for example:
import { createMetadata } from '@repo/seo/metadata';
export const metadata = createMetadata({
title: 'My Page',
description: 'My page description',
image: '/my-page-image.png',
});