Statac

Problems explained

Not data

warning A warning says what Statac did instead, and the build goes on.

A file in data/ is neither YAML nor JSON. Statac reads files ending in .yaml, .yml or .json there, and leaves anything else out.

What you’ll see

warning  Not data: `data/people.txt` isn't YAML or JSON
  Save it as `.yaml` or `.json`, or move it out of `data/`.
  More: https://statac.dev/e/not-data/

In the terminal the message also names the file and line where there is one, and marks the exact text.

Why Statac warns

Templates reach the files in data/ as site.data, and a file Statac can’t read would never arrive there. Statac goes on without it and says so, in case you meant templates to have it.

How to fix it

Save the file as YAML or JSON with the matching ending, or move it out of data/. A file to be published as it is, such as a PDF, belongs in static/ or beside the page that links to it.

Example

data/people.txt:

Person 1
Person 2

Saved as data/people.yaml, it reaches templates as site.data.people:

- Person 1
- Person 2

Its name

Namenot-data
In the terminalstatac explain not-data
To stop showing itquiet: [not-data] in statac.yaml, once you have understood it. Statac still counts it.

Something unclear or wrong? Open an issue on GitHub.