Ethan
Ethan

Reputation: 3798

Jekyll max excerpt length

I am trying to get a an excerpt of my posts to serve as the description meta tag on my page. Is there any way to limit the excerpt characters to 156?

Here is my current code:

{{ page.excerpt | strip_html | strip_newlines}}

Upvotes: 5

Views: 2176

Answers (1)

marcanuy
marcanuy

Reputation: 23972

Use the truncate filter:

{{ page.excerpt | strip_html | strip_newlines | truncate: 156 }}  

Upvotes: 16

Related Questions