Next.js · Junior · Question 50 of 75
What title does the page get with export const metadata = { title: 'Profile' } in the page and title: { template: '%s | Shop', default: 'Shop' } in the layout?
- ✓Correct answer:
Profile | Shop - 2
Shop | Profile - 3
Profilewithout the template
Explanation
title.template from the layout is applied to titles of child segments: %s is replaced with the page's title. default is used if a child segment doesn't set a title. This saves you from repeating the site name on every page.