{% extends 'partials/base.html.twig' %}
{% set blog_image = page.media.images[page.header.hero_image] ?: page.media.images|first %}
{% set collection = page.collection() %}
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true)  %}
{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}

{% block body %}

  <section class="header-wrapper">
    <div class="title">
      <h1>{{page.title}}</h1>
    </div>
    <div class="cat">
      {% include 'partials/taxonomylist.html.twig' with {base_url: my_url, taxonomy: 'tag',  children_only: true} %}
    </div>
  </section>

  <section class="body-wrapper">
    {% block item %}
      {% for child in collection.order('date','asc') %}
        {% if child.header.date|date("ymd") >= "now"|date("ymd")  %}
          {% include 'partials/cal-list-event.html.twig' with {blog: page, page: child} %}
        {% endif %}
      {% endfor %}
      {{date_b}}
    {% endblock %}
  </section>

{% endblock %}

{% block newsletter %}
  {% include 'partials/newsletters.html.twig' %}
{% endblock %}
