Twig :: summary
The summary
filter will extract the first X paragraphs from the given text.
Since
0.1.0
Usage
summary(paragraphCount = 1)
Parameters
-
paragraphCount
: intThe amount of paragraphs used to in the summary.
Example Usage
When writing a blog, there's likely to be a page listing all of the blog posts and the first paragraph summarizing the post.
{% for post in collections.posts %}
<article>
<p><strong>{{ post.title }}</strong></p>
<div>
{{ post.content | summary }}
</div>
</article>
{% endfor %}