{% load comment_format %}
<div class="post-list">
    {% for post in posts %}
        <article class="post-card">
            <h3 class="post-card-title"><a href="{% url 'blog:post_detail' post.slug %}">{{ post.name|truncatewords:6 }}</a></h3>
            <div class="post-meta">
                <span class="post-date"><i class="fa-regular fa-calendar"></i> {{ post.created_at|date:"d F Y" }}</span>
                {% if post.tags %}
                    <span class="sep">•</span>
                    <span class="post-tags"><i class="fa-solid fa-tag"></i> {{ post.tags }}</span>
                {% endif %}
            </div>
            <p class="post-excerpt">{{ post.description|comment_markdown|truncatewords:26 }}</p>
            <div class="post-actions">
                <a class="button button-secondary" href="{% url 'blog:post_detail' post.slug %}">Lire l'article →</a>
            </div>
        </article>
    {% empty %}
        <p>Aucun article pour le moment.</p>
    {% endfor %}
    </div>
