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

@ -92,6 +92,8 @@ joindin:
lanyrd:
url: http://lanyrd.com/profile/opdavies
latest_posts: 3
linkedin:
url: http://uk.linkedin.com/in/opdavies

View file

@ -0,0 +1,12 @@
.latest-posts
@extend .panel
@extend .panel-default
&__heading
@extend .panel-heading
ul
@extend .list-group
li
@extend .list-group-item

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>

View file

@ -12,6 +12,10 @@
</div>
{% include('availability') %}
{% if page.url == '/.' %}
{% include ('latest-posts') %}
{% endif %}
{% endblock %}
</div>
{% endblock %}

View file

@ -23,6 +23,8 @@ tools:
- { title: CentOS, website: https://www.centos.org/about }
- { title: Git, website: http://git-scm.com }
- { title: Ansible, website: http://www.ansible.com }
use:
- posts
---
# About Me