I’m a very beginner in eleventy. And also in English !
I’m studying alone. I have an html page gallery.html with a dropdown menu. I have a javascript file that will add some html content dynamically depending on the item selected in the dropdown menu.
In the js file that is src/js I want to access to a collection object that I created in .eleventy.js named portraits. But i don’t know how to to it.
In the js if I write collections.portraits, if I start, collections object is not known.
I also want to access from this js file to datas in json files. these datas are in src/_data/photos.json. If I write photos.aKey in the js, if i start 11th server, photos is not defined.
How can i access to these datas from my js file ?
js calling json datas
if i start 11th server, and launch localhost, i have in the console : photos is not defined.
ReferenceError: photos is not defined
js using the collections object created in .eleventy.js
ReferenceError: collections is not defined