I'd like to access a data file I have in the _data folder and use this in a plugin generator, but I'm not sure how. I have:
site.data.projects.each do |project|
...
end
But when I try to compile it tells me "undefined method 'projects' for Hash(...) NoMethodError. What is the correct syntax?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With