Metadata

Docs




Dynamic SSG (with segment)

12:59:03 PM

/metadata/ssg/[segment]

export async function generateStaticParams() {
  return [{ segment: 'page-1' }, { segment: 'page-2' }, { segment: 'page-3' }];
}

export async function generateMetadata(
  { params }: Props,
  parent: ResolvingMetadata,
): Promise<Metadata> {
  const { title } = await parent;

  return {
    title: `${title?.absolute} - ${params.segment}`,
  };
}

export async function generateMetadata(): Promise<Metadata> {
  return {
    title: 'Dynamic SSG',
  };
}