The JSON module registers a data loader for .json files in /.lunet/data/. It depends on the Datas module.
Create a data file at /.lunet/data/project.json:
{
"name": "Lunet",
"version": "1.0"
}
Access it in templates:
site.data.project.name
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 |
// and /* */) are allowed and skipped during parsing.site.data container