diff --git a/source/_layouts/post.html.twig b/source/_layouts/post.html.twig index 6c6439f82..71228e57d 100644 --- a/source/_layouts/post.html.twig +++ b/source/_layouts/post.html.twig @@ -24,11 +24,10 @@ {% include 'post/header' %} {% include 'post/intro-image' %} - {% if page.excerpt %} - {{ page.excerpt|markdown }} - {% endif %} - - {% block content %}{% endblock %} + <div class="mb-6"> + {% block excerpt %}{% endblock %} + {% block content %}{% endblock %} + </div> {% include 'post/twitter-link' %} {% include 'post/tags' %} diff --git a/source/blog.html b/source/blog.html index 816f88570..6d3723050 100644 --- a/source/blog.html +++ b/source/blog.html @@ -19,10 +19,12 @@ use: [posts] {% include 'post/intro-image' with { page: post } %} - {% if post.excerpt %} - {{ post.excerpt|markdown }} + {% if post.blocks.excerpt %} + {{ post.blocks.excerpt|raw }} + {% elseif '<!-- split -->' in post.blocks.content %} + {{ post.blocks.content|split('<!-- split -->')|first|raw }} {% 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 %} <p><a href="{{ post.url }}">Read more →</a></p>