How to stop a for loop that has "include tags" in certain item in Nunjucks?

Viewed 22

I have this code on my blog site but I want the loop to stop in, for example, the second item/article or third

<div class="container mar2ritlft">
    <div class="content3col">

        {%- for article in collections.article | reverse -%}
        {% include 'article-post.njk' %}
        {%- endfor -%}

    </div>
</div>

Ps: the "collections.article" is blogs that have "article" tag in the metaData

0 Answers
Related