Add YAML to supported databag formats

This commit is contained in:
Johan Thelin 2021-06-05 23:08:06 +02:00
parent 101aef6bf2
commit 34061b5b55
1 changed files with 5 additions and 4 deletions

View File

@ -18,12 +18,13 @@ function to access databags.
## Supported Formats ## Supported Formats
Databags go into the `databags/` folder in your project. There are two Databags go into the `databags/` folder in your project. There are three
formats supported: key/value pairs as ini files as well as JSON files: formats supported: key/value pairs as ini files as well as JSON and YAML files:
| Extension | Format | Extension | Format
| --------- | -------- | --------- | --------
| `.json` | JSON | `.json` | JSON
| `.yaml` | YAML
| `.ini` | INI Files with or without sections | `.ini` | INI Files with or without sections
## Navigating Bags ## Navigating Bags
@ -31,8 +32,8 @@ formats supported: key/value pairs as ini files as well as JSON files:
Dotted notation is used to navigate into data bags which are globally Dotted notation is used to navigate into data bags which are globally
merged together. This means that if you have a file named `i18n.ini` merged together. This means that if you have a file named `i18n.ini`
with a section `[en]` and a key `CLICK_HERE` the path `i18n.en.CLICK_HERE` with a section `[en]` and a key `CLICK_HERE` the path `i18n.en.CLICK_HERE`
will target that key. For JSON files further nesting is possible. You will target that key. For JSON and YAML files further nesting is possible.
can also just target a section and the return value will be a dictionary You can also just target a section and the return value will be a dictionary
which can for instance be used with the [tojson :ref](../templates/filters/tojson/) which can for instance be used with the [tojson :ref](../templates/filters/tojson/)
filter. filter.