oliverdavies.uk/source/blog.html

42 lines
1.2 KiB
HTML
Raw Normal View History

2015-03-16 11:16:42 +00:00
---
layout: default
title: Blog
2015-06-15 09:37:37 +01:00
generator: pagination
2015-06-15 09:38:09 +01:00
pagination:
2015-08-10 00:14:36 +01:00
max_per_page: 10
2015-03-19 11:36:09 +00:00
use:
2015-08-10 00:14:36 +01:00
- posts
2015-03-16 11:16:42 +00:00
---
2015-06-18 17:50:37 +01:00
{% block body_classes %}page--blog page--blog__list{% endblock %}
{% block content %}
2015-07-03 01:37:02 +01:00
<h1>Blog</h1>
2015-03-16 11:16:42 +00:00
2015-07-22 07:21:43 +01:00
<ul class="posts">
2015-07-03 01:37:02 +01:00
{% for post in page.pagination.items %}
2015-07-22 07:21:43 +01:00
<li class="post">
2015-08-09 01:47:07 +01:00
{% include 'post_header' with { page: post, title_tag: 'h2' } %}
2015-06-29 12:52:37 +01:00
2015-07-03 01:37:02 +01:00
{% if post.blocks.excerpt %}
{{ post.blocks.excerpt|raw }}
{% else %}
<p>{{ post.blocks.content|raw|split(' ')|slice(0,50)|join(' ')|replace({ 'h2':'h3' })|raw }} &hellip;</p>
2015-07-03 01:37:02 +01:00
{% endif %}
2015-07-21 18:03:01 +01:00
2015-07-03 01:37:02 +01:00
<a href="{{ post.url }}">Read more &rarr;</a>
2015-07-22 07:21:43 +01:00
</li>
2015-07-03 01:37:02 +01:00
{% endfor %}
2015-07-22 07:21:43 +01:00
</ul>
2015-06-15 09:53:06 +01:00
2015-07-03 01:37:02 +01:00
{% if page.pagination.previous_page or page.pagination.next_page %}
<nav>
{% if page.pagination.previous_page %}
<a href="{{ site.url }}{{ page.pagination.previous_page.url }}">Newer Items</a>
{% endif %}
{% if page.pagination.next_page %}
<a href="{{ site.url }}{{ page.pagination.next_page.url }}">Older Items</a>
{% endif %}
</nav>
2015-06-15 09:53:06 +01:00
{% endif %}
2015-08-20 23:08:02 +01:00
{% endblock content %}