0
我正在構建一個jekyll站點。我有一個循環設置 -
{% for article in site.posts limit:5 %} {% if article.tag == "infographic" %} <a class="infographic tag" href="/tags/infographics.html">{{ article.tag }}</a> {% endif %} {% endfor %}
選擇一個帖子以在液體環路中顯示
此循環吐出我的信息圖標記中的最新5個職位。我想循環產生只有第三個最新帖子。任何想法使這發生?
謝謝!這也適用於我的標籤。另一種選擇是 - {{forloop.index == 3}}:https://help.shopify.com/themes/liquid/objects/for-loops - 我更喜歡你的。 – Andrew
編輯 - 經過進一步測試,你是對的,重要的是使用類別 – Andrew