Still.Data (Still v0.8.0) View Source

Loads data files and makes the data available in templates. Any file in the data_ folder will be loaded using the file's name as a key. For instance, a file in data/site.json_ with the contents:

{
  "title": "Still"
}

Will be available in the templates as Data.global().site.title.

You can also use folders to organise files; the same file in __data/default/site.json_ would be available in the templates as Data.global().default.site.title.

The data folder can be changed in the config:

config :still, Still.Data,
  folder: "_data"

Notice: The data folder name should start with an underscore, otherwise Still will consider the pages inside as web pages or assets to build.

It supports JSON (.json), YAML (.yml) and Elixir (.exs, .ex).

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Functions