{% for filter in courses.filters %}
  {% if filter.selected? %}
    <div class="np-catalog-courses">
        <div id="category-{{ filter.value }}">
          <div class="np-resource-subtitle category-name">{{ filter.name }}</div>
          <div class="row row-with-thumbnails">
            {% for course in courses.in_catalog %}
              {% assign course_categories = course.categories | map: "id" %}
      
              {% if course_categories contains filter.value %}
                <div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content">
                  {% include "cards_course" with course %}
                </div>
              {% endif %}
            {% endfor %}
          </div>
        </div>
    </div> 
  {% endif %}
{% endfor %}