【发布时间】:2016-02-28 18:16:51
【问题描述】:
我想遍历集合中具有特定字段集(非空)的所有项目。我试过这个:
{% assign papers_with_demos=site.data.papers | where:"demo", not blank %}
{% if papers_with_demos.size > 0 %}
<h2>demos</h2>
{% for paper in papers_with_demos %}]
...
{% endfor %}
{% endif %}
但它不起作用;所有论文都被退回。
我的目标是,只有在一篇或多篇带有演示的论文时才会显示标题“演示”。
【问题讨论】: