Then you’ll have to use conditionals along with an efficient criterion / criteria. For example:
{% for post in site.posts %}
{% if <criterion_satisfied> %}
- [{{ post.title }}]({{ post.url }})
{% endif %}
{% endfor %}
Or filter out relevant posts before the iteration like demonstrated here: