Views and Static Files
Views and Static Files
Colonel uses EJS views with optional layout and partials.
View Payload Shape
Controllers can return:
[
'base/index',
{ titleData: 'Welcome' },
'base/layouts/main',
'base/partials/footer',
'base/partials/title'
]
Only template and data are required.
Layout Composition
Kernel renders:
- child template
- footer partial
- title partial
- final layout
Static Files
Static requests are detected using configured prefixes and served from public.
Configure accepted content types in:
- src/config/acceptedStaticContentTypes.ts
Configure static path prefixes in:
- src/config/staticPaths.ts