Zinnia (django blog) fix for 'Continue reading' persistance

/
5

The template for zinnia in the version installed by pip always sets continue_reading to “1”, so the “Continue reading…” link always pops up on every article. Even articles with less than 100 words.

To remedy this, you need modify the content-loop block in entry_search.html and entry_list.html like so:

{% if object.html_content|truncatewords_html:100|length == object.html_content|length %}
    {% include object.content_template with object_content=object.html_content|safe continue_reading=0 %}
{% else %}
    {% include object.content_template with object_content=object.html_content|truncatewords_html:100|safe continue_reading=1 %}
{% endif %}

Obviously, you will want to copy over the HTML files from the zinnia package into your project for modification before doing the above :)


TOY MODE
π