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
I have a bunch of .json files in a subfolder under _data, so the file structure is _data/projects/projectid.json.
I'm pulling in data from these pages to populate a case study blog post, in which I specify a title, the layout, and the projectID.
I'm expecting {{ projects.projectID.title }} to give me the value of the title key in the file _/data/projects/cats.json if I specify projectID: 'cats' in the frontmatter, but it doesn't.
To Reproduce
Calling {{ projectID }} in the template does populate with the projectID of cats as it should.
Calling {{ projects.cats.title }} works, populating with the title of the Cats project.
{{ projects.cats.title }} Cats: A fancy project title
{{ projects.projectID.title }} [ nothing ]
My guess is that eleventy is trying to find the title of a file called projectID.json that doesn't actually exist, but I have no idea how to circumvent that. I tried nesting the variable with handlebars and that returned errors. , and none of them worked. Any thoughts?
Additional context
My guess is that eleventy is trying to find the title of a file called projectID.json that doesn't actually exist, but I have no idea how to circumvent that. I tried nesting the variable with handlebars and that returned errors.
The text was updated successfully, but these errors were encountered:
Describe the bug, expected behavior
I have a bunch of .json files in a subfolder under
_data
, so the file structure is_data/projects/projectid.json
.I'm pulling in data from these pages to populate a case study blog post, in which I specify a title, the layout, and the
projectID
.I'm expecting
{{ projects.projectID.title }}
to give me the value of thetitle
key in the file_/data/projects/cats.json
if I specifyprojectID: 'cats'
in the frontmatter, but it doesn't.To Reproduce
{{ projectID }}
in the template does populate with theprojectID
of cats as it should.{{ projects.cats.title }}
works, populating with thetitle
of the Cats project.{{ projects.projectID.title }}
doesn't work. Theoretically, the template would populateprojectID
with cats as I have assigned and output like Install hangs - dependency slug-rfc asking for a passphrase #2, but it doesn't.So to be clear, I get
{{ projectID }}
cats{{ projects.cats.title }}
Cats: A fancy project title{{ projects.projectID.title }}
[ nothing ]My guess is that eleventy is trying to find the
title
of a file calledprojectID.json
that doesn't actually exist, but I have no idea how to circumvent that. I tried nesting the variable with handlebars and that returned errors. , and none of them worked. Any thoughts?Additional context
My guess is that eleventy is trying to find the
title
of a file calledprojectID.json
that doesn't actually exist, but I have no idea how to circumvent that. I tried nesting the variable with handlebars and that returned errors.The text was updated successfully, but these errors were encountered: