Data Files

Cobalt supports loading yaml, json, and toml from _data and making it available as site.data.<DIR>.<FILE>.

Example

In _data/animals/dogs.yml:

- name: Corgi
- name: Malamute

which can be accessed via site.data.animals.dogs.

You can now render the list in a template:

<ul>
{% for breed in site.data.animals.dogs %}
  <li>{{ breed.name }}</li>
{% endfor %}
</ul>