Use post excerpt from front matter
This commit is contained in:
parent
04b5c94e40
commit
b80f0df305
|
@ -24,6 +24,10 @@
|
||||||
{% include 'post/header' %}
|
{% include 'post/header' %}
|
||||||
{% include 'post/intro-image' %}
|
{% include 'post/intro-image' %}
|
||||||
|
|
||||||
|
{% if page.excerpt %}
|
||||||
|
{{ page.excerpt|markdown }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
|
||||||
{% include 'post/twitter-link' %}
|
{% include 'post/twitter-link' %}
|
||||||
|
|
|
@ -19,12 +19,10 @@ use: [posts]
|
||||||
|
|
||||||
{% include 'post/intro-image' with { page: post } %}
|
{% include 'post/intro-image' with { page: post } %}
|
||||||
|
|
||||||
{% if post.blocks.excerpt %}
|
{% if post.excerpt %}
|
||||||
{{ post.blocks.excerpt|raw }}
|
{{ post.excerpt|markdown }}
|
||||||
{% elseif '<!-- split -->' in post.blocks.content %}
|
|
||||||
{{ post.blocks.content|split('<!-- split -->')|first|raw }}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>{{ post.blocks.content|raw|striptags|split(' ')|slice(0,50)|join(' ')|replace({ 'h2': 'h3' }) }} …</p>
|
{{ post.blocks.content|split('\n\n')|first|raw }}
|
||||||
{% 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