layout: default


<article class=“post” itemscope itemtype=“schema.org/BlogPosting”>

<header class="post-header">
  <h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
  <p class="post-meta">
    <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%-d/%-m/%Y" }}</time>
    {% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}
  </p>
</header>
<div class="post-content" itemprop="articleBody">
  {{ content }}
</div>

</article>

<h4 style=“margin-top: 40px; margin-bottom: 20px;”>Contenuti correlati: </h4> <div class=“correlati-list”> <ul> {% assign maxRelated = 4 %} {% assign minCommonTags = 1 %} {% assign maxRelatedCounter = 0 %}

{% for post in site.posts %}

{% assign sameTagCount = 0 %}
{% assign commonTags = '' %}

{% for category in post.categories %}
  {% if post.url != page.url %}
    {% if page.categories contains category %}
      {% assign sameTagCount = sameTagCount | plus: 1 %}
      {% capture tagmarkup %} <span class="label label-default">{{ category }}</span> {% endcapture %}
      {% assign commonTags = commonTags | append: tagmarkup %}
    {% endif %}
  {% endif %}
{% endfor %}

{% if sameTagCount >= minCommonTags %}
  <li>
    <a href="{{ site.baseurl }}{{ post.url }}">
      {{ post.title }}
    </a>
  </li>
  {% assign maxRelatedCounter = maxRelatedCounter | plus: 1 %}
  {% if maxRelatedCounter >= maxRelated %}
    {% break %}
  {% endif %}
{% endif %}

{% endfor %} </ul> </div><!– correlati-list –>