Update post template for excerpts
This commit is contained in:
parent
fbbb2b6b18
commit
1a41e95207
|
@ -24,11 +24,10 @@
|
||||||
{% include 'post/header' %}
|
{% include 'post/header' %}
|
||||||
{% include 'post/intro-image' %}
|
{% include 'post/intro-image' %}
|
||||||
|
|
||||||
{% if page.excerpt %}
|
<div class="mb-6">
|
||||||
{{ page.excerpt|markdown }}
|
{% block excerpt %}{% endblock %}
|
||||||
{% endif %}
|
{% block content %}{% endblock %}
|
||||||
|
</div>
|
||||||
{% block content %}{% endblock %}
|
|
||||||
|
|
||||||
{% include 'post/twitter-link' %}
|
{% include 'post/twitter-link' %}
|
||||||
{% include 'post/tags' %}
|
{% include 'post/tags' %}
|
||||||
|
|
|
@ -19,10 +19,12 @@ use: [posts]
|
||||||
|
|
||||||
{% include 'post/intro-image' with { page: post } %}
|
{% include 'post/intro-image' with { page: post } %}
|
||||||
|
|
||||||
{% if post.excerpt %}
|
{% if post.blocks.excerpt %}
|
||||||
{{ post.excerpt|markdown }}
|
{{ post.blocks.excerpt|raw }}
|
||||||
|
{% elseif '<!-- split -->' in post.blocks.content %}
|
||||||
|
{{ post.blocks.content|split('<!-- split -->')|first|raw }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ post.blocks.content|split('\n\n')|first|raw }}
|
<p>{{ post.blocks.content|raw|striptags|split(' ')|slice(0,50)|join(' ')|replace({ 'h2': 'h3' }) }} …</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<p><a href="{{ post.url }}">Read more →</a></p>
|
<p><a href="{{ post.url }}">Read more →</a></p>
|
||||||
|
|
Reference in a new issue