We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The global data applied for eleventyComputed here ...
eleventyComputed
eleventyConfig.addGlobalData( 'eleventyComputed', require('./lib/data/eleventy-computed.js') )
... overrides any data that I set in my consuming app, e.g.
eleventyConfig.addGloblData('eleventyComputed.myGlobalVar', () => (data) => "abc");
I would expect the above to result in;
eleventyComputed: { eleventyNavigation: { key: (data) => getKey(data), parent: (data) => getParent(data), excerpt: (data) => data.eleventyNavigation.excerpt || data.description }, myGlobalVar: (data) => "abc", }
But myGlobalVar is actually not present.
myGlobalVar
I believe this is a result of the issue described here.
Hacking a change into /main/index.js fixes the issue:
/main/index.js
eleventyConfig.addGlobalData( 'eleventyComputed.eleventyNavigation', require('./lib/data/eleventy-computed.js').eleventyNavigation )
I'll look at submitting a PR for this.
The text was updated successfully, but these errors were encountered:
fix: do not override eleventyComputed
51f3241
Fixes x-govuk#346
801127c
Fixes #346
Successfully merging a pull request may close this issue.
The global data applied for
eleventyComputed
here ...... overrides any data that I set in my consuming app, e.g.
I would expect the above to result in;
But
myGlobalVar
is actually not present.I believe this is a result of the issue described here.
Hacking a change into
/main/index.js
fixes the issue:I'll look at submitting a PR for this.
The text was updated successfully, but these errors were encountered: