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
Dots in Global Data Files are used for dot-pathing instead of preserved in key name #1242
Labels
breaking-change
This will have to be included with a major version as it breaks backwards compatibility.
bug
Milestone
Comments
Dermah
added a commit
to Dermah/eleventy
that referenced
this issue
Jun 9, 2020
Dermah
added a commit
to Dermah/eleventy
that referenced
this issue
Jun 10, 2020
Yes this is absolutely a bug! |
I would love a PR on this although I don’t think Dermah@0b88d8d is quite accurate? |
Snapstromegon
added a commit
to Snapstromegon/eleventy
that referenced
this issue
Jul 29, 2021
Dots in the global datafile path leads to data beeing incorrectly nested. This commits changes the behavior so a datafile a.b.json will create an entry with data["a.b"] instead of data.a.b. The old behavior was a bug according to 11ty#1242. The implementation makes use of lodashs set and get functions which also take object paths in array form instead of string. That way we can implement this safely. Signed-off-by: Raphael Höser <raphael@hoeser.info>
Snapstromegon
added a commit
to Snapstromegon/eleventy
that referenced
this issue
Jul 29, 2021
This commit adds an additional testcase for 11ty#1242 to avoid future regressions. Signed-off-by: Raphael Höser <raphael@hoeser.info>
zachleat
added a commit
that referenced
this issue
May 10, 2022
Fix #1242 Dot Pathing in data file paths
zachleat
added
the
breaking-change
This will have to be included with a major version as it breaks backwards compatibility.
label
May 10, 2022
Merged #1912, this will ship with 2.0.0-canary.10. Thank you @Snapstromegon! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking-change
This will have to be included with a major version as it breaks backwards compatibility.
bug
Describe the bug
If a data file has dots in the file name, the dots describe an object path that the data in the file is available at.
To Reproduce
In an eleventy project:
_data/sites/11ty.dev.json
that just contains:index.liquid
that just contains:npx @11ty/eleventy
Expected behavior
I don't know if this is actually expected behaviour, but I would have assumed it would output
The 11ty docs seem to operate under this assumption, because sites with dots in the filename don't show up on the leaderboard due to the unexpected dot-path behaviour.
Environment:
Additional context
The text was updated successfully, but these errors were encountered: