刘凡 9ff4d1d109 add S3,archive,truncate | 2 роки тому | |
---|---|---|
.. | ||
templatetags | 2 роки тому | |
.gitattributes | 2 роки тому | |
.gitignore | 2 роки тому | |
README.md | 2 роки тому |
You shoud pass 2 arguments, the min and de max chars. The template tag will truncate the text on the last space
{% load smarttruncate %}
<div>
My description is {{ description|smartcut:"50:70" }}
</div
This is specially usefull when you don't have controll over the meta titles,descriptions...etc. And you can still respect the max lenght.
<meta property="og:title" content="{{ description|smartcut:"50:60" }}">
<meta property="og:description" content="{{ meta.description|smartcut:"120:158" }}">