Create pages from yaml data

Hi all. Tell me, can jekyll generate pages from a yaml file as middleman

example in middleman

data/people.yml
friends:

  • url: tom_url.html
    name: Tom
    age: 30

  • url: dick_url.html
    name: Dick
    age: 20

config.rb
data.people.friends.each do |friend|
proxy “#{friend.url}”, “friend_detail_template.html”, locals: { friend: friend }
end

it will automatically generate pages: tom_url.html and dick_url.html
and through the locals, will access the properties of the object

tom_url.html

friend.name >> Tom
friend.age >> 30

1 Like

As far I know, you can by writing custom plugin in _plugins directory.

Seems that can be the way, as I see at http://jimpravetz.com/blog/2011/12/generating-jekyll-pages-from-data/

I think the solution is jekyll-datapage_gen.

It includes a working example too.