2016-09-30 75 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,如果可能的話。

相關問題