How to access the data file in the plugin generator?

I would like to access the data file that I have in the _data folder and use it in the plugin generator, but I'm not sure how to do this. I have:

site.data.projects.each do |project| ... end 

But when I try to compile, it tells me "<9090" "projects" for Hash (...) NoMethodError. What is the correct syntax?

+7
plugins jekyll
source share
1 answer

If you post what your _data file looks like, I can give you a better answer, but try:

 site.data['projects'].each do |project| ... end 
+2
source share

All Articles