Added truncation to post text in list view
authorNeil Smith <neil.git@njae.me.uk>
Tue, 11 Oct 2016 10:47:41 +0000 (11:47 +0100)
committerNeil Smith <neil.git@njae.me.uk>
Tue, 11 Oct 2016 10:47:41 +0000 (11:47 +0100)
blog/templates/blog/post_list.html

index eb1647a5e1e304356185d1d82854b53e2d9bce29..d3fa8ef089a277633c22b6f35368db9d3f503963 100644 (file)
@@ -7,7 +7,7 @@
                <p>published: {{ post.published_date }}</p>
        </div>
        <h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
-       <p>{{ post.text|linebreaksbr }}</p>
+       <p>{{ post.text|linebreaksbr|truncatewords_html:100 }}</p>
 </div>
 {% endfor %}
 {% endblock %}
\ No newline at end of file