2016-09-30 58 views

回答

2

简单。只是这样做:

{% for post in site.posts %} 
    {% if forloop.index == 1 or forloop.index == 4 %} 
    output wide post 
    {% else %} 
    output normal post 
    {% endif %} 
{% endfor %} 
1

更好的答案:各地各岗位创建类似的div,并与像这样的CSS对付它们:

div {width: 50℅;} 
div:nth-child(1), div:nth-child(4) {width: 100%;} 

布局应该是在CSS,如果可能的话。

相关问题