鉴于此JSON:
case studies: [
[ "Nubaru",
["Nubaru Yearly Report", "Web design", "2013", "/case-studies/Nubaru.html", "/images/case-studies/Nubaru.png"]
],
[ "Ekande",
["Ekande application", "Web application design", "2013", "/case-studies/Ekande.html", "/images/case-studies/Ekande.png"]
]
]
这个Liquid(使用Jekyll):
<ul>
{% for items in page.case-studies %}
{% for item in items %}
<li>
{{ item }}
<!-- How to get sub items? -->
</li>
{% endfor %}
{% endfor %}
</ul>
答案 0 :(得分:1)
对于第一个问题,您是否尝试使用第三个循环(如{% for subItem in {{ item[2] }} %}
)或直接访问,例如数据{{ item[2][3] }}
?
对于第二个,您可以使用{% assign %}
,如下所示:{% assign caseDate = 'your-value' %}
,cf。 http://wiki.shopify.com/Liquid#Variable_Assignment