You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here I have created the computed property populatedCategories to get an array of categories all data related to the current article. I want to reuse this property in many places.
Describe the bug
I have two collections -
articles
andcategories
.For categories i used this markdown structure:
For articles i used this markdown structure:
In front-matter section of post
categories
arefileSlug
s of corresponding category markdown file.I want to use directory js-data files for more flexible data transforming and cleaner html templates. Data file for articles collection directory (https://github.com/monochromer/eleventy-deep-nested-computed-data/blob/main/src/articles/articles.11tydata.js):
Here I have created the computed property
populatedCategories
to get an array of categories all data related to the current article. I want to reuse this property in many places.An example of such use - single article page and corresponding data file (https://github.com/monochromer/eleventy-deep-nested-computed-data/blob/main/src/entries/article/article.11tydata.js):
And template file:
But instead of desired
populatedCategories
inside computed propertyarticleCategories
i get''
.I found two workaround solutions:
To Reproduce
Steps to reproduce the behavior:
npm ci
npm start
Expected behavior
Computed property
articleCategories
return array of categories data.Environment:
The text was updated successfully, but these errors were encountered: