Ajout d'un champ description au modèle Post avec migration associée, mise à jour des templates pour utiliser ce champ, et amélioration du formatage des commentaires Markdown avec gestion des titres typographiques.

This commit is contained in:
mrtoine 2025-12-15 21:29:26 +01:00
parent 43af8bd0d8
commit 4a48425374
6 changed files with 38 additions and 4 deletions

View file

@ -1,7 +1,8 @@
{% 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 }}</a></h3>
<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 %}
@ -9,7 +10,7 @@
<span class="post-tags"><i class="fa-solid fa-tag"></i> {{ post.tags }}</span>
{% endif %}
</div>
<p class="post-excerpt">{{ post.content|striptags|truncatewords:26 }}</p>
<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>