Based on the documentation, in the App Router, metadata title templates are evaluated in order starting from the root segment down to the final page segment [1]. Each segment can define its own metadata, but they follow specific rules for merging and inheritance:
Title templates only apply to child segments below where they are defined [2]
Each title template requires its own default title [2]
Here’s an example of how title templates work across segments:
import type { Metadata } from 'next'
export const metadata: Metadata = {
title: {
template: '%s | Acme',
default: 'Acme', // a default is required when creating a template
},
}