Closed lhokktyn closed 1 week ago
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 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.