Skip to content
HomePagesHomePages template kit

composeSections

Build one typed handle per composed section instance.

Build one typed handle per composed section instance. The object key is the section key (override with section: when composing a section twice), and object insertion order is composition order.

That section key IS the section’s folder name on disk, verbatim and kebab ("price-range", not a camelCased spelling of it), because every stage resolves a composed entry by matching it against the discovered section folders. An entry matching no folder is refused everywhere it is read: check reports it as an unknown section, and the dev server refuses the page naming the key. The reverse is not an error — a section folder nothing composes is ordinary work in progress.

Import from @homepages/template-kit.

function composeSections<T extends { [K in keyof T]: ComposeEntry; }>(entries: T): { [K in keyof T]: SectionInstanceHandle<T[K]["schema"]>; }
Name Type Required Description
entries T required

{ [K in keyof T]: SectionInstanceHandle<T[K]["schema"]>; }