composePages
Lay the composed sections out across the artifact and hand back keyed page handles: the object key is the page id (stable identity: renaming a label must not move it) and object insertion order is artifact order — what nav menus and the editor's page bar render.
Lay the composed sections out across the artifact and hand back keyed page handles: the object key is the page id (stable identity: renaming a label must not move it) and object insertion order is artifact order — what nav menus and the editor’s page bar render. The handles are keyed rather than a bare array so later composition layers reference pages typed — renaming a page breaks the build, never the editor.
Import from @homepages/template-kit.
Signature
Section titled “Signature”function composePages<T extends { [K in keyof T]: AuthoredPage; }>(pages: T): { readonly [K in keyof T]: T[K] & { readonly id: string; }; }Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
pages |
T |
required |
Returns
Section titled “Returns”{ readonly [K in keyof T]: T[K] & { readonly id: string; }; }
See also
Section titled “See also”canvascomposeCanvasescomposeSectionsdefineTemplateorgsForScopepagevisibilityForScopeAuthoredCanvasAuthoredTemplateComposeEntryDefineTemplateCommonPageOptionsRoutedPageSectionInstanceHandleSiteInstanceSlotRefUnroutedPageAuthoredPageComposedCanvasComposedCanvasesComposedPageComposedPagesDefineTemplateInputTemplateScope