Next.js Discord

Discord Forum

Metadata Template Title is not working

Unanswered
Willow shoot sawfly posted this in #help-forum
Open in Discord
Willow shoot sawflyOP
I'm new to Next, and just started converting my SvelteKit project.
I initiated a Next project (next@15.2.0-canary.72) and created a basic layout.

But title.template in metadata title just do not work. I literally copypasted code from docs (https://nextjs.org/docs/app/api-reference/functions/generate-metadata#template) and all my pages show "Page" instead of "Page | Company" even though the template is "%s | Company".

2 Replies

Willow shoot sawflyOP
Okay, I figured it out. It only works for pages in sub-routes, but doesn't work for a page.tsx in the same dir as layout.tsx. It doesn't seem to be mentioned in the docs so it might be worth adding there.
Dwarf Crocodile
is this what u are talking about?