Sha256: f7106174275d5479c095c1784adc88498fade6c9699716bd5036407900f4a656

Contents?: true

Size: 1.7 KB

Versions: 11

Compression:

Stored size: 1.7 KB

Contents

---
layout: default
---

<article class="post" itemscope itemtype="http://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 -->

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
teatro-vecchio-0.2.9 _layouts/post.html
teatro-vecchio-0.2.8 _layouts/post.html
teatro-vecchio-0.2.7 _layouts/post.html
teatro-vecchio-0.2.6 _layouts/post.html
teatro-vecchio-0.2.5 _layouts/post.html
teatro-vecchio-0.2.4 _layouts/post.html
teatro-vecchio-0.2.3 _layouts/post.html
teatro-vecchio-0.2.1 _layouts/post.html
teatro-vecchio-0.2.0 _layouts/post.html
teatro-vecchio-0.1.9 _layouts/post.html
teatro-vecchio-0.1.8 _layouts/post.html