Oliver Davies
167617dc0c
Replace h2s with h3s so that they are not at the same level as the h2s for the post titles.
40 lines
1.2 KiB
HTML
40 lines
1.2 KiB
HTML
---
|
|
layout: default
|
|
title: Blog
|
|
generator: pagination
|
|
pagination:
|
|
max_per_page: 5
|
|
use:
|
|
- posts
|
|
---
|
|
{% block body_classes %}page--blog page--blog__list{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Blog</h1>
|
|
|
|
{% for post in page.pagination.items %}
|
|
<article class="post">
|
|
{% include 'post-header' with { page: post, title_tag: 'h2' } %}
|
|
|
|
{% if post.blocks.excerpt %}
|
|
{{ post.blocks.excerpt|raw }}
|
|
{% else %}
|
|
<p>{{ post.blocks.content|raw|split(' ')|slice(0,50)|join(' ')|replace({ 'h2':'h3' })|raw }} …</p>
|
|
{% endif %}
|
|
|
|
<a href="{{ post.url }}">Read more →</a>
|
|
</article>
|
|
{% endfor %}
|
|
|
|
{% 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>
|
|
{% endif %}
|
|
{% endblock %}
|