Skip to content

Commit

Permalink
Improve truncated blog summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
paulemberson committed Sep 10, 2017
1 parent 1aa9f4f commit 4190dbe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/partials/blog_item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
{% set show_prev_next = true %}
{% endif %}
{% elseif truncate and readmore is sameas(false) %}
{{ page.content|truncate(200, true) }}
{% elseif truncate and page.summary != page.content %}
<p>
{{ page.summary|striptags }}
<a href="{{ page.url }}">more...</a>
{{ page.content|replace({'</p>':'<br />'})|striptags('<br>')|truncate(200, true) }}
</p>
{% elseif truncate and page.summary != page.content %}
{{ page.summary|striptags('<br><p>') }}
<a href="{{ page.url }}">more...</a>
{% elseif truncate %}
<p>
{{ page.content|truncate(550)|striptags }}
{{ page.content|replace({'</p>':'<br />'})|striptags('<br>')|truncate(550) }}
<a href="{{ page.url }}">more...</a>
</p>
{% else %}
Expand Down

0 comments on commit 4190dbe

Please sign in to comment.