在不使用插件的情况下从yaml创建多个jekyll页面

在不使用插件的情况下从yaml创建多个jekyll页面,jekyll,github-pages,Jekyll,Github Pages,我在上的一个Jekyll网站上工作,我希望能够为组中的每个人都有一个页面。我知道如果集合中的文件被标记,我可以使用集合生成页面。我希望能够在集合中包含yaml文件,然后在将每个yaml文件传递到模板后生成页面 人员文件可能如下所示: # person-1.yaml name: thingy m. bob position: coffee fetcher bio: no bio needed # person-2.yaml name: mars e. pan position: head hon

我在上的一个Jekyll网站上工作,我希望能够为组中的每个人都有一个页面。我知道如果集合中的文件被标记,我可以使用集合生成页面。我希望能够在集合中包含yaml文件,然后在将每个yaml文件传递到模板后生成页面

人员文件可能如下所示:

# person-1.yaml
name: thingy m. bob
position: coffee fetcher
bio: no bio needed

# person-2.yaml
name: mars e. pan
position: head honcho
bio: expert in everything
然后创建如下模板文件(people template.md):

输出将是
/people/
下的单个文件,即
/people/person-1
/people/person-2
,其格式与模板中相同,但使用
.yaml
文件


我正在使用GitHub页面,所以我不想使用任何不支持的插件。

我已经实现了类似的功能。。。这是我创建的设置:

- _Layouts
  - person.html
...
people
  - index.md (list of people - see code below)
  - _posts
    - 2015-01-01-person-one.md (ordering defined by date which is thrown away)
    - 2015-01-02-person-two.md
    - 2015-01-03-person-three.md
    ...
然后,对于人员列表,您可以使用以下内容:

<ul>
{% for person in site.categories.people %}
    <li><a href="{{ person.url }}>{{ person.name}}"></a></li>
{% endfor %}
</ul>
我希望这给了你一些开始。。。我认为将
\u posts
文件夹放在
people
文件夹下会自动将类别设置为
people
。如果我错了,只需在yaml中添加
category:people

如果要删除日期部分,可以在_config.yaml中设置post URL的模式


祝你好运。。。您也可以使用以下方法解决此问题。。。以前没用过。
<ul>
{% for person in site.categories.people %}
    <li><a href="{{ person.url }}>{{ person.name}}"></a></li>
{% endfor %}
</ul>
---
name: "thingy m. bob"
# using quotes to avoid issues with non-alpha characters
position: "coffee fetcher"
bio: "no bio needed"

layout: person
---

any markdown if you want more of a description