Add latest posts to front page
This commit is contained in:
parent
490ddc6267
commit
e1d01a2714
|
@ -92,6 +92,8 @@ joindin:
|
||||||
lanyrd:
|
lanyrd:
|
||||||
url: http://lanyrd.com/profile/opdavies
|
url: http://lanyrd.com/profile/opdavies
|
||||||
|
|
||||||
|
latest_posts: 3
|
||||||
|
|
||||||
linkedin:
|
linkedin:
|
||||||
url: http://uk.linkedin.com/in/opdavies
|
url: http://uk.linkedin.com/in/opdavies
|
||||||
|
|
||||||
|
|
12
assets/sass/components/_latest-posts.sass
Normal file
12
assets/sass/components/_latest-posts.sass
Normal 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
|
16
source/_includes/latest-posts.html.twig
Normal file
16
source/_includes/latest-posts.html.twig
Normal 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>
|
|
@ -12,6 +12,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include('availability') %}
|
{% include('availability') %}
|
||||||
|
|
||||||
|
{% if page.url == '/.' %}
|
||||||
|
{% include ('latest-posts') %}
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -23,6 +23,8 @@ tools:
|
||||||
- { title: CentOS, website: https://www.centos.org/about }
|
- { title: CentOS, website: https://www.centos.org/about }
|
||||||
- { title: Git, website: http://git-scm.com }
|
- { title: Git, website: http://git-scm.com }
|
||||||
- { title: Ansible, website: http://www.ansible.com }
|
- { title: Ansible, website: http://www.ansible.com }
|
||||||
|
use:
|
||||||
|
- posts
|
||||||
---
|
---
|
||||||
# About Me
|
# About Me
|
||||||
|
|
||||||
|
|
Reference in a new issue