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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -