有没有一种方法可以循环浏览jekyll系列的前端内容?

有没有一种方法可以循环浏览jekyll系列的前端内容?,jekyll,liquid,yaml-front-matter,prose,Jekyll,Liquid,Yaml Front Matter,Prose,我有一个不输出的Jekyll集合,但其中的元素显示在单个页面上,如下所示: {% for element in site.collection %} {{ element.content }} {% endfor %} {% for element in site.collection %} {{ element.content }} {% for front_matter in element %} <!-- do stuff --> {% endfor

我有一个不输出的Jekyll集合,但其中的元素显示在单个页面上,如下所示:

{% for element in site.collection %}
  {{ element.content }}
{% endfor %}
{% for element in site.collection %}
  {{ element.content }}
  {% for front_matter in element %}
    <!-- do stuff -->
  {% endfor %}
{% endfor %}
我希望能够做到以下几点:

{% for element in site.collection %}
  {{ element.content }}
{% endfor %}
{% for element in site.collection %}
  {{ element.content }}
  {% for front_matter in element %}
    <!-- do stuff -->
  {% endfor %}
{% endfor %}
但是,当我试图将这些配对(
foo
bar
)配置为可以通过pross.io轻松更新时,它们不能嵌套在其他值下。如果有 尽管如此,我还是会接受这个答案


非常感谢

可以在Jekyll集合中循环元素的变量:

{% for items in site.my_collection %}
  {% for item in items %}
    {{ item }}: {{ items[item] }}
  {% endfor %}
{% endfor %}
但重要的是要记住,还有其他元数据也可用,并将包含在迭代中,如
路径
url
,等等,以及您的前端事务,例如
我的收藏/something.md

next:

path: _my_collection/something.md

output: <p></p>

url: /my_collection/something.html

id: /my_collection/something

content: <p></p>

collection: my_collection

relative_path: _my_collection/something.md

excerpt: <p></p>

previous:

draft: false

categories:

slug: something

ext: .md

tags:

date: 2017-05-23 14:43:57 -0300
下一步:
路径:_my_collection/something.md
输出:

url:/my_collection/something.html id:/我的收藏/什么 内容:

收藏:我的收藏 相对路径:\我的\集合/something.md 摘录:

以前的: 草稿:假 类别: 鼻涕虫:什么 分机号码:.md 标签: 日期:2017-05-2314:43:57-0300
这非常有效,谢谢。我原以为它会返回键值对,但我猜它只会返回键。我一直在寻找这个循环。谢谢。