page
Declare one page: its menu/editor `label` (required on every page, single-page templates included), then either a `path` (`"/"` for the root page, else one lowercase-kebab segment such as `"/gallery"`) for a website page, or no path at all for a rendered class's pathless surface — the two forms return distinct types, and each `defineTemplate` branch accepts only its own.
Declare one page: its menu/editor label (required on every page, single-page
templates included), then either a path ("/" for the root page, else one
lowercase-kebab segment such as "/gallery") for a website page, or no path
at all for a rendered class’s pathless surface — the two forms return
distinct types, and each defineTemplate branch accepts only its own. The
sections are in render order; a handle listed here and on another page is
ONE shared instance rendered on both.
Import from @homepages/template-kit.
Signature
Section titled “Signature”function page(label: string, path: string, sections: readonly SectionInstanceHandle[], opts?: PageOptions): RoutedPagefunction page(label: string, sections: readonly SectionInstanceHandle[], opts?: PageOptions): UnroutedPageParameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
label |
string |
required | |
path |
string |
required | |
sections |
readonly SectionInstanceHandle[] |
required | |
opts |
PageOptions |
optional |
Returns
Section titled “Returns”RoutedPage
See also
Section titled “See also”canvascomposeCanvasescomposePagescomposeSectionsdefineTemplateorgsForScopevisibilityForScopeAuthoredCanvasAuthoredTemplateComposeEntryDefineTemplateCommonPageOptionsRoutedPageSectionInstanceHandleSiteInstanceSlotRefUnroutedPageAuthoredPageComposedCanvasComposedCanvasesComposedPageComposedPagesDefineTemplateInputTemplateScope