JSON module

The JSON module registers a data loader for .json files in /.lunet/data/. It depends on the Datas module.

Example

Create a data file at /.lunet/data/project.json:

{
  "name": "Lunet",
  "version": "1.0"
}

Access it in templates:

site.data.project.name

Type conversion

JSON values are converted to Scriban-compatible types:

JSON type Scriban type Notes
Object ScriptObject Nested property access
Array ScriptArray Index and iteration
String string
Number int, long, decimal, or double Smallest fitting type is used
Boolean bool
null null

Parsing behavior

  • Trailing commas are allowed (non-standard JSON extension).
  • Comments (// and /* */) are allowed and skipped during parsing.
  • Parse errors are reported and the file is skipped.

See also