YAML front matter for Jekyll and nested lists

Posted by motleydev on Stack Overflow See other posts from Stack Overflow or by motleydev
Published on 2012-10-06T15:35:22Z Indexed on 2012/10/06 15:36 UTC
Read the original article Hit count: 288

Filed under:
|

I have a set of nested yaml lists with something like the following:

title: the example
image: link.jpg
products:
 - top-level: Product One
   arbitrary: Value
   nested-products:
    - nested: Associated Product
      sub-arbitrary: Associated Value
 - top-level: Product Two
   arbitrary: Value
 - top-level: Product Three
   arbitrary: Value

I can loop through the products with no problem using for item in page.products and I can use a logic operator to determine if nested products exist - what I CAN'T do is loop through multiple nested-products per iteration of top-level

I have tried using for subitem in item and other options - but I can't get it to work - any ideas?

© Stack Overflow or respective owner

Related posts about yaml

Related posts about jekyll