Data modules (site.data)

Data files under /.lunet/data/ are loaded into site.data before content processing begins, making them available in config.scriban, layouts, includes, and page templates.

Supported formats

Format Extension Module
YAML .yml, .yaml YAML module
JSON .json JSON module
TOML .toml TOML module

Example

Create /.lunet/data/project.yml:

name: Lunet
url: "https://github.com/xoofx/lunet"
stars: 123

Use it in a page or layout:

site.data.project.name
site.data.project.stars

Subdirectories create nested objects:

/.lunet/data/
  project.yml      → site.data.project
  blog/
    tags.yml       → site.data.blog.tags

See also

  • Datas module — the site.data container and loading mechanism
  • YAML module — also provides front matter parsing for content pages