YAML front matter for Jekyll and nested lists
- by motleydev
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?