{% extends "redberry/_base.html" %}

{% block content %}

    {% include "redberry/_jumbotron.html" %}

    <div id="red-posts-index" class="container">
        {% if not posts %}
            No posts yet.
        {% endif %}

        {% for post in posts %}
            <div class="col-md-4">
                <div class="red-post panel">
                    <h3>
                        <a href="{{ url_for('redberry.show_post', slug=post.slug) }}">{{ post.title }}</a>
                    </h3>

                    {% if post.categories %}
                        <p>
                            {% for category in post.categories %}
                                <a class="label label-success" href="{{ url_for('redberry.show_category', category_slug=category.slug) }}">{{ category.title }}</a>
                            {% endfor %}
                        </p>
                    {% endif %}

                    {{ post.summarise() | safe }}

                    <a class="btn btn-primary btn-lg red-post-more" href="{{ url_for('redberry.show_post', slug=post.slug) }}">
                        Read More
                    </a>
                </div>
            </div>
        {% endfor %}
    </div>


{% endblock %}


