{% extends "andablog/base.html" %}
{% load andablog_tags %}

{% block andablog_meta %}
    <meta name="description" content="Latest blog entries">
{% endblock %}

{% block andablog_page_title %}
    Latest Blog Entries
{% endblock %}

{% block andablog_content %}
    {% for entry in entries %}
        <div class="row">
            <div class="col-sm-10 blog-main">
                <div class="blog-post">
                    <h2 class="blog-post-title"><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a>{% if not entry.is_published %} <span class="label label-default">Draft</span>{% endif %}</h2>
                    <p class="blog-post-meta">{{ entry.published_timestamp|date:"DATE_FORMAT" }}{% if entry.author %} by {{ entry.author|authordisplay }}{% endif %}</p>
                    <p>
                        {# TODO: "Better support for truncating markup" #2 #}
                        {# Truncate derived from: Avg reading speed (3.33 words/s) * Average attention span (8s) #}
                        {{ entry.content|truncatewords_html:26 }} <a href="{{ entry.get_absolute_url }}">(More...) {% include "andablog/comments_count_snippet.html" with comment_object=entry %}</a>
                    </p>
                </div><!-- /.blog-post -->
            </div>
        </div>
    {% endfor %}

    {% include "andablog/pagination_snippet.html" with page_obj=page_obj %}
{% endblock %}
