首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Jekyll和嵌套列表的YAML首要问题

Jekyll和嵌套列表的YAML首要问题
EN

Stack Overflow用户
提问于 2012-10-06 23:35:23
回答 1查看 17.6K关注 0票数 28

我有一组嵌套的yaml列表,如下所示:

代码语言:javascript
复制
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

我可以使用for item in page.products顺利地遍历产品,并且可以使用逻辑运算符来确定是否存在嵌套产品--我不能做的是在每次top-level迭代中遍历多个nested-products

我试过使用for subitem in item和其他选项--但我不能让它工作--有什么想法吗?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12761152

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档