{% set miniposts_category = theme_var('miniposts_category') %}
{% set miniposts_number = config.theme.miniposts_number %}

<section>
  <header class="">
    <h3>{{ 'FUTURE.FEATURED'|t }}</h3>
  </header>
  <div class="mini-posts">
    {% for p in page.evaluate({'@taxonomy.category':miniposts_category}).order('header.order', 'asc').slice(0,miniposts_number) %}
      <article class="mini-post">
        <header>
          <h3>
            <a href="{{ p.url }}">{{ p.title }}</a>
          </h3>
          {% if plugin.translate_date.enabled %}
            <time class="published" datetime="{{ p.date|td(null, "Y-m-d") }}">{{ p.date|td }}</time>
          {% else %}
            <time class="published" datetime="{{ p.date|date("Y-m-d") }}">{{ p.date|date("M j, Y") }}</time>
          {% endif %}
          <a href="{{ p.url }}" class="author"><img src="{{ p.media[p.header.avatarImage].url}}" alt=""/></a>
        </header>
        <a href="{{ p.url }}" class="image">
          {% if p.header.primaryImage %}
            {{ p.media[p.header.primaryImage].cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
          {% else %}
            {{p.media.images|first.cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
          {% endif %}
        </a>
      </article>
    {% endfor %}
  </div>
</section>
<!-- End of featured Section -->
