---
layout: default
---

{% include setlang.html %}

{% comment %}
{% assign subnav = site.data[page.subnav] %}
{% include linklist.html items=subnav dynamic=true %}
{% if site.disqus.shortname %} {% include disqus_comments.html %} {% endif %}
{% capture pills %}{% include pills.html items=page.tags  %}{% endcapture %}
{% include sideblock.html title=t.home_projects_expand content=pills %}
{% endcomment %}


<div>
  <section class="postslisting postslisting--home position-relative">
    <div class="postslisting__headerbkg "></div>
    <div class="postslisting__header ">

      <div class="container pt-4 d-flex w-100">
        {% if paginator.total_pages > 1 %}
        <h1>{{ page.title }} - {{ t.paginator_page }} {{ paginator.page }} {{t.paginator_of}} {{ paginator.total_pages }}</h1>
        {% else %}
        <h1>{{ page.title }}</h1>
        {% endif %}
        
        {% if active_lang=='it' %}
        <div class="postslisting__filtertag ml-auto d-flex">
        <a href="#" class="align-self-center d-flex" data-activate-element
            data-activeid="filterTags">{{ t.news_filter }} <span class="ml-3 it-expand"></span><span
              class="ml-3 it-collapse"></span></a>

        </div>
        {% endif %}
      </div>
      <div class="container postslisting__tags deactive" data-activatedby="filterTags">
        {% capture categories %}
        {% for category in site.tags %}{{ category[0] }}:{% endfor %}
        {% endcapture %}

        {% assign categories_ = categories | strip | split: ':' %}

        {% if active_lang=='it' %}
          {% include pills.html items=categories_ small=true %}
        {% endif %}
      </div>
    </div>

    <div class="postslisting__content my-2 my-md-4">
      <div class="container postlisting__sticky my-2 ">
        <div class="row row-eq-height ">
          {% for post in paginator.posts limit:2 %}
          <div class="col-md-6 mb-4 {%if forloop.first%}pr-md-3{%endif%} {%if forloop.last%}pl-md-3{%endif%}">
            {% include card.html
            date=post.date
            cta=post.cta
            author=post.author
            title=post.title
            link=post.url
            text=post.subtitle
            hasImage=false
            categories=post.tags
            flat=false
            classes='h-100 d-flex align-items-start flex-column'
            %}
          </div>
          {% endfor %}
        </div>
      </div>
      <div class="container my-3 my-md-5">
        <div class="row row-eq-height px-2 px-md-0">
          {% for post in paginator.posts offset:2 %}
          {% assign division_by_3 = forloop.index | modulo:3 %}

          <div class="col-md-4">
            {% include card.html
                date=post.date
                author=post.author
                title=post.title
                link=post.url
                text=post.subtitle
                hasImage=false
                categories=post.tags
                flat=true
                cta=post.cta
                classes='h-100 d-flex align-items-start flex-column'
                %}
          </div>
          {% if division_by_3==0 %}
          <div class="w-100 d-none d-md-block postslisting__hr"></div>

          {% endif %}

          {% endfor %}
        </div>
        
        {% if paginator.total_pages > 1 %}
        {% assign division_by_page_size = paginator.total_posts | modulo:paginator.per_page %}
        {% assign division_by_page_size = division_by_page_size | minus:2 %}
        {% assign division_by_page_size = division_by_page_size | modulo:3 %}
        {% if paginator.page == paginator.total_pages and division_by_page_size != 0 %}
        <div class="w-100 d-none d-md-block postslisting__hr"></div>  
        {% endif %}
        <nav class="pagination-wrapper justify-content-center">
          <ul class="pagination" aria-label="{{ t.paginator_page }} {{ paginator.page }} {{t.paginator_of}} {{ paginator.total_pages }}">
            <li
              {% if paginator.page != 1 %}
                class="page-item"
              {% else %}
                class="page-item disabled"
              {% endif %}
            >
              <a class="page-link" href="{{ paginator.previous_page_path }}" 
                {% if paginator.page == 1 %}
                  tabindex="-1" aria-hidden="true"
                {% endif %}
              >
                <svg class="icon icon-primary"><use xlink:href="/assets/svg/sprite.svg#it-chevron-left"></use></svg>
                <span class="sr-only">{{ t.paginator_previous_page }}</span>
              </a>
            </li>
            <li class="page-item"><span class="page-link">{{ paginator.page }}</span></li>
            <li class="page-item"><span class="page-link">/</span></li>
            <li class="page-item"><span class="page-link">{{ paginator.total_pages }}</span></li>
            <li class="page-item sr-only">
              <a class="page-link" href="#" aria-current="page">{{ t.paginator_page }} {{ paginator.page }} {{t.paginator_of}} {{ paginator.total_pages }}</a>
            </li>
            <li
              {% if paginator.page != paginator.total_pages %}
                class="page-item"
              {% else %}
                class="page-item disabled"
              {% endif %}
            >
              <a class="page-link" href="{{ paginator.next_page_path }}"
                {% if paginator.page == paginator.total_pages %}
                  tabindex="-1" aria-hidden="true"
                {% endif %}
              >
                <span class="sr-only">{{ t.paginator_next_page }}</span>
                <svg class="icon icon-primary"><use xlink:href="/assets/svg/sprite.svg#it-chevron-right"></use></svg>
              </a>
            </li>
          </ul>
        </nav>
        {% endif %}
      </div>
    </div>

  </section>
</div>

{% include banner-joinus.html %}
