Add latest posts to front page

This commit is contained in:
Oliver Davies 2016-06-06 18:25:49 +01:00
parent 490ddc6267
commit e1d01a2714
5 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,16 @@
<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>