突然,使用了一段时间的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时,所有内容都在那里...怎么了?
发布于 2017-06-26 15:02:10
jekyll 3.5的更新起作用了。
https://stackoverflow.com/questions/44750887
复制相似问题