突然,现在使用jekyll 3.4.3,这个用于渲染集合项的循环已经停止为我工作了......
{% for work in site.work %}
{% if work.featured %}
{% assign mod = forloop.index | modulo:2 %}
{% if mod == 0 %}
<a href="{{work.url}}"><div class="col-xs-12 col-md-6 col-md-offset-5 featured-work">
<div class="featured-work-title">{{work.title|replace: " ","</br>"}}</div>
<div class="featured-work-image" style="background-image: url(/images/{{work.image}});"></div>
</div></a>
{% else %}
<a href="{{work.url}}"><div class="col-xs-12 col-md-6 featured-work">
<div class="featured-work-title">{{work.title|replace: " ","</br>"}}</div>
<div class="featured-work-image" style="background-image: url(/images/{{work.image}});"></div>
</div></a>
{% endif %}
{% endif %}
{% endfor %}
这是我的_config.yaml
collections:
work:
output: true
permalink: /work/:path/
这是其中一个项目的样本
---
layout: work
featured: true
title: Eluu.ee
link: http://eluu.ee
punchline: What does it take to sell a toy.
image: eluu.jpg
disciplines:
- Website
- Ecommerce
- Voog
year: Ongoing
---
In late 2016, I .....
没有任何东西被放到页面上,没有给出错误..当单独输出site.collections.work时,所有内容都在那里......出了什么问题?
答案 0 :(得分:0)
jekyll 3.5的更新工作。