ruby - Jekyll access data files from inside a plugin -
how access information inside "_data" folder inside "_plugin"?
for example have _data/items.yml item data1: info data2: moreinfo
inside plugin in render method want able def render(context) <<--markup.strip <p>#{site.data.items.data1}</p> markup end
ideas? have been able site.data.items have not been able access children elements (data1, data2)
your data file _data/items.yml
has item
key well.
item data1: info data2: moreinfo
so data1
accessed site.data.items.item.data1
and
data2
site.data.items.item.data2
Comments
Post a Comment