Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YAML to supported databag formats #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions content/docs/api/databags/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ function to access databags.

## Supported Formats

Databags go into the `databags/` folder in your project. There are two
formats supported: key/value pairs as ini files as well as JSON files:
Databags go into the `databags/` folder in your project. There are three
formats supported: key/value pairs as ini files as well as JSON and YAML files:

| Extension | Format
| --------- | --------
| `.json` | JSON
| `.yaml` | YAML
| `.ini` | INI Files with or without sections

## Navigating Bags

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`
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
can also just target a section and the return value will be a dictionary
will target that key. For JSON and YAML files further nesting is possible.
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/)
filter.

Expand Down