Curvea

Core Concepts

Document Layer

The document layer controls the outer HTML shell.

The document file is:

src/Document.csc

It is optional. If missing, Curvea uses a built-in default document.

Basic document

@document

<!DOCTYPE html>
<html lang="{{ site.language }}">
  <head>
    {{ head }}
  </head>
  <body>
    {{ app }}
  </body>
</html>

Special variables

The document has two important special variables.

Injected engine-generated head content.

This can include:

  • charset meta
  • viewport meta
  • theme runtime script
  • favicon link
  • extracted head content
  • SEO tags
  • external stylesheets
  • inline styles

{{ app }}

The fully rendered page and layout output.

Required elements

A custom document must include:

  • <html>
  • <head>
  • <body>

If any are missing, the renderer throws an error.

Default document

If src/Document.csc does not exist, Curvea uses:

<!DOCTYPE html>
<html lang="{{ site.language }}">
<head>
{{ head }}
</head>
<body>
{{ app }}
</body>
</html>

Document styles and scripts

@style blocks inside Document.csc are injected into the head.

@script blocks inside Document.csc are injected into the body.

Language injection

The renderer injects or updates the <html lang="..."> attribute using site.language.

Theme attributes

The renderer adds base theme attributes to <html> when they are missing:

<html data-theme-mode="system" data-theme="light">