-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Extend Metadata with YAML data files defined in configuration #175
base: master
Are you sure you want to change the base?
Conversation
Hi, thanks for the pull request. We cannot merge a pull request without tests though, could you write some? Also I would rather see the section named import:
- data/my-custom-file.yml
- data/other-file.yml Since it would be a straight import the keys would not be necessary: it makes the whole thing simpler to think about imports than "data files", and it also restricts less the possibilities (those files could contain configuration, not data). |
57bf035
to
e0b8861
Compare
Done something and added some unit tests too. Before merging, there's something that I'm not quite sure it's the best idea. I'm using Don't sure we want to merge though, but difficult to handle collision if we do not merge. |
I think it's fine to overwrite the whole key and not merge values. It would be very difficult to do otherwise because what we would like to happen depends a lot on the configuration value (sometimes we would want to merge, sometimes we would want to replace). Always replace is easier. |
I took the liberty to implement a first attempt at mimicking Jekyll
_data
directory by loading files in configuration as if it was included incouscous.yml
.It works by defining the
dataFiles
in yourcouscous.yml
:Path to those files are resolved related to project source directory, repository root by default. You can then use values in any twig templates by their keys, as if it was defined in the
couscous.yml
file itself.See #174 for more informations.