How layers merge
The chain is walked outermost first: the root layout, each layout, then the page.
The chain is walked outermost first: the root layout, each layout, then the page. Each layer is merged onto what the
layers above resolved, with these rules (merge.ts):
- Titles. A string title is wrapped in the nearest
templateabove it;%sis replaced.absolutesets the title and skips the template.defaultis used only when no layer sets a title.template: nullclears the inherited template for the layers below. - Every other field replaces the value above it, as a whole. A page's
openGraphreplaces the layout'sopenGraph; the fields are not merged one by one. The exception isother, whose keys merge. nullremoves the value above it.metadataBasereplaces the base above it. It is parsed once, after the merge, and must be an absolute http(s) URL; anything else fails the render with aTypeError.generateMetadatareceives the merged result of the layers above asparent. Itstitleis the string the page shows, so a page can extend it.