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:
parent
43af8bd0d8
commit
4a48425374
6 changed files with 38 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load comment_format %}
|
||||
{% block title %} | Blog : {{ post.name }}{% endblock %}
|
||||
{% block og_title %}Blog de Partir De Zéro : {{ post.name }}{% endblock %}
|
||||
{% block description %}{{ post.content|striptags|truncatewords:20 }}{% endblock %}
|
||||
|
|
@ -18,7 +19,7 @@
|
|||
</header>
|
||||
|
||||
<article class="post-content prose">
|
||||
{{ post.content|safe }}
|
||||
{{ post.content|comment_markdown }}
|
||||
</article>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue