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

access eleventyComputed data from another data file #3531

Open
saiballo opened this issue Nov 8, 2024 · 1 comment
Open

access eleventyComputed data from another data file #3531

saiballo opened this issue Nov 8, 2024 · 1 comment

Comments

@saiballo
Copy link

saiballo commented Nov 8, 2024

Operating system

Linux Ubuntu Mint 20.04

Eleventy

3.0.0

Describe the bug

Hello,

in src/data I have two files:

  • eleventyComputed.js
  • commonData.js

inside eleventyComputed I have:

module.exports = {
	"data1": "foo",
	"data2": (data) => {

		if (typeof data["env"] === "bar") {

			return "foo";

		} else {

			return "bar";
		}
	}
};

Ok, Can I access data2 in commonData.js? How? If I get eleventyComputed.data1 all it's ok and return data (static) but I I try data2 it return the function instead the result

Reproduction steps

No response

Expected behavior

No response

Reproduction URL

No response

Screenshots

No response

@Ryuno-Ki
Copy link
Contributor

Ryuno-Ki commented Nov 8, 2024

Related to #3218

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

2 participants