How to limit the number of words?


#1

It is always not possible that the heading or the description will always be of the same size of we need to limit the number of words so that at the end we get three dots ...

How to do it?


#2

You can do this with CSS.


#3

Nope. I didn’t work for me. :confused:


#4

maybe make an extra front matter variable for short description? jekyll also has post.excerpt, but I don’t think it is a good fit for what you want to do.

You could also do this in JS.


#5

You can generally do this:
{{ some_variable | truncatewords: 20 }}