Jekyll - Collection - 输出:true不起作用

时间:2017-01-24 22:25:27

标签: jekyll github-pages

我对Jekyll很新,到目前为止真的很喜欢它。现在我陷入了困境。我有一个活动集合。

如果我说输出:false,事件由for循环呈现。

但是如果我设置输出:for循环不会呈现真实事件

循环事件

{% for event in site.events %}
<div class="{% cycle 'style1', 'style2' %} row">
  <div class="col-md-3"><a href="{{ site.baseurl }}{{ event.url }}">{{ event.title }}</a></div>
  <div class="col-md-6">{{ event.summary }}</div>
  <div class="col-md-3">{{ event.date | date: "%b %-d, %Y" }}</div>
</div>
{% endfor %}

Config.yml,输出为false

collections:
  events:
    output: false

Config.yml,输出为true

collections:
  events:
    output: true

从教程中,似乎只需将输出设置为true,它就应该有效。我正在设置输出:true,因为我想为每个文档分别设置一个页面。

它在github页面上工作。但是在本地

上工作不正常

这是我的存储库网址https://github.com/RobinNagpal/Ion-Jekyll-Theme

1 个答案:

答案 0 :(得分:2)

您在yaml前面使用了一个日期字段。

由于这些日期在将来,您的活动不会发布(与帖子收集相同)。

为了发布您的活动,您可以在future: true中设置_config.yml。这将指示jekyll发布(创建文件)未来事件。