Rendering Flow
Curvea renders pages through a predictable build-time pipeline.
Page → Layout → Document → Final HTML
1. Parse
The engine parses a .csc file into an AST-like object containing:
- kind
- name
- props
- layout usage
- imports
- loads
- paginate config
- data
- seo
- styles
- scripts
- body
2. Create page entries
For each page, the build creates one or more build entries:
- static page entry
- dynamic JSON page entries
- Markdown content entries
- paginated entries
3. Create scope
The page scope is created from:
- global template values
- page-local
@data - loaded data from
@load pagedatasitedata- pagination data when applicable
4. Resolve page template
The resolver applies:
- raw code protection
- loops
- conditionals
- components
- variable replacement
5. Apply layout
If the page uses @use, the layout is rendered with the page content as {{ slot }}.
6. Transform built-ins
Built-in helpers such as Icon, menu, and lightbox are transformed or injected when detected.
7. Resolve SEO
SEO metadata is resolved from:
@seo- page data
- site config
- fallbacks
8. Render document
The document shell receives:
{{ head }}{{ app }}- site values
- page values
9. Rewrite base paths
Root-relative href and src values are rewritten according to site.basePath.
10. Format and write HTML
The final HTML is formatted and written to dist/.