{% if page.url == '/.' %}
<div class="latest-posts">
<div class="latest-posts__heading">Latest blog posts</div>
<ul>
{% for post in data.posts|slice(0, site.latest_posts) %}
<li class="post">
<span class="post__title">
<a href="{{ post.url }}">
{{ post.title }}
</a>
</span> -
<span class="post__date">{{ post.date|date(site.default_date_format) }}</span>
</li>
{% endfor %}
</ul>
</div>
{% endif %}