{% extends "base.html" %}

{% block page_title %}Blog{% endblock page_title %}

{% block content %}
<h1>Blog</h1>
<ul class="blog-list">
    {% for post in posts %}
    <li class="post-card">
        {% if post.image %}<img src="{{ post.image }}" alt="" class="post-card-image">{% endif %}
        <a href="{{ post.url | safe }}">{{ post.title }}</a>
        {% if post.created %}<time>{{ post.created }}</time>{% endif %}
        {% if post.description %}<p>{{ post.description }}</p>{% endif %}
        {% if post.tags | length > 0 %}
        <ul class="tag-list">
            {% for tag in post.tags %}
            <li><a href="/tags/{{ tag.slug }}/">{{ tag.name }}</a></li>
            {% endfor %}
        </ul>
        {% endif %}
    </li>
    {% endfor %}
</ul>
{% if pagination %}{% include "pagination.html" %}{% endif %}{% endblock content %}