Don't have to use excerpt block

This commit is contained in:
Oliver Davies 2015-07-03 01:37:02 +01:00
parent 76e7b5b222
commit abc42cf82d

View file

@ -10,27 +10,29 @@ use:
{% block body_classes %}page--blog page--blog__list{% endblock %} {% block body_classes %}page--blog page--blog__list{% endblock %}
{% block content %} {% block content %}
<h1>Blog</h1> <h1>Blog</h1>
{% for post in page.pagination.items %} {% for post in page.pagination.items %}
<article class="post"> <article class="post">
{% include 'post-header' with { page: post, title_tag: 'h2' } %} {% include 'post-header' with { page: post, title_tag: 'h2' } %}
{% if post.blocks.excerpt %} {% if post.blocks.excerpt %}
{{ post.blocks.excerpt|raw }} {{ post.blocks.excerpt|raw }}
{% endif %} {% else %}
<a href="{{ post.url }}">Read more &rarr;</a> {{ post.blocks.content|raw|split(' ')|slice(0,50)|join(' ')|raw }} &hellip;
</article> {% endif %}
{% endfor %} <a href="{{ post.url }}">Read more &rarr;</a>
</article>
{% endfor %}
{% if page.pagination.previous_page or page.pagination.next_page %} {% if page.pagination.previous_page or page.pagination.next_page %}
<nav> <nav>
{% if page.pagination.previous_page %} {% if page.pagination.previous_page %}
<a href="{{ site.url }}{{ page.pagination.previous_page.url }}">Newer Items</a> <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 %} {% endif %}
{% if page.pagination.next_page %}
<a href="{{ site.url }}{{ page.pagination.next_page.url }}">Older Items</a>
{% endif %}
</nav>
{% endif %}
{% endblock %} {% endblock %}