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

Directory data in js front matter #1332

Closed
ivanov-v opened this issue Jul 27, 2020 · 3 comments
Closed

Directory data in js front matter #1332

ivanov-v opened this issue Jul 27, 2020 · 3 comments

Comments

@ivanov-v
Copy link

ivanov-v commented Jul 27, 2020

Describe the bug
I use Directory Data File for localization (en.json -> {"locale": "en"}), and want to use locale variable in front matter.
image

To Reproduce
Steps to reproduce the behavior:
Use ---js front matter and directory data file:
image

Expected behavior
I expect to be substituted with the locale value "en"

Environment:

  • OS and Version: Mac
  • Eleventy Version: 0.11.0

Additional context
It's work with liquid, but I cant use before to filter out some item:

image

@samuelpath
Copy link
Contributor

Hi @ivanov-v

Looking at the sources of data documentation, it seems to me that Front Matter Data takes precedence over Directory Data Files.

I think that this implies that you can use only use data from sources higher up in the cascade, meaning that

I'm not an expert but this is how I understand the documentation.

Does this make sense to you?

Regards,
Samuel

@samuelpath
Copy link
Contributor

Maybe related to #915 ?

@zachleat
Copy link
Member

This is almost certainly related to Data Deep Merge. This is now enabled by default in Eleventy 1.0 and newer https://www.11ty.dev/docs/data-deep-merge/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants