Computed data property returning empty - am I doing something wrong? #1625
-
Hi all, I'm trying to set a piece of data in a computed data that relies on In
and in
I would expect something to be output, but the output is always:
Edit: I am using version
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@philwolstenholme Maybe this? module.exports = {
noCssUrl: (data) => {
if (data.page.filePathStem === "/index") {
return `${data.page.filePathStem}.no-css.html`;
}
return `${data.page.filePathStem}/index.no-css.html`;
},
noJsUrl: (data) => {
if (data.page.filePathStem === "/index") {
return `${data.page.filePathStem}.no-js.html`;
}
return `${data.page.filePathStem}/index.no-js.html`;
},
}; I noticed in https://www.11ty.dev/docs/data-computed/#real-world-example that they mention an "eleventyComputed.js global data file", but they don't include the nested |
Beta Was this translation helpful? Give feedback.
@philwolstenholme Maybe this?
I noticed in https://www.11ty.dev/docs/data-computed/#real-world-example that they mention an "eleventyComputed.js global data file", but they don't include the nested
eleventyComputed
property in that example (you can search for "eleventyComputed.js" to jump …