mirror of
https://github.com/metagov/govarch-website.git
synced 2025-06-19 01:23:10 +00:00
add option to show post excerpts on posts with a title
This commit is contained in:
13
_includes/post-excerpt.html
Normal file
13
_includes/post-excerpt.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% capture excerpt %}
|
||||
{{ post.excerpt | replace: "<p>", "" | replace: "</p>", "" }}
|
||||
{% endcapture %}
|
||||
|
||||
{% assign excerpt_length = excerpt | size %}
|
||||
|
||||
<em class="post-link__excerpt">
|
||||
{% if excerpt_length > 140 %}
|
||||
{{ excerpt | truncatewords: 20, '…' }}
|
||||
{% else %}
|
||||
{{ excerpt }}
|
||||
{% endif %}
|
||||
</em>
|
Reference in New Issue
Block a user