From f7ca30e0df1c532a66a1659e59d45b9cb868c18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 17 Jul 2024 10:12:11 +0200 Subject: [PATCH] beautify the post list page --- content/posts/19700101_hello.md | 1 + content/posts/post1.md | 2 +- content/posts/post2.md | 1 + content/posts/post3.md | 1 + content/templates/jinja2/post-list.html | 49 +++++++++++++++++++++++-- content/templates/jinja2/post.html | 1 + jssg/models.py | 2 +- tsconfig.json | 6 +++ 8 files changed, 58 insertions(+), 5 deletions(-) diff --git a/content/posts/19700101_hello.md b/content/posts/19700101_hello.md index 658eadc..66ed934 100644 --- a/content/posts/19700101_hello.md +++ b/content/posts/19700101_hello.md @@ -3,6 +3,7 @@ title Hello, world date 1970-01-01T00:00+00:00 category test abstract +author Bob --- { diff --git a/content/posts/post1.md b/content/posts/post1.md index 96c6635..e4e76bd 100644 --- a/content/posts/post1.md +++ b/content/posts/post1.md @@ -3,7 +3,7 @@ title R&D et Veille techno - Petit point sur nos projets internes date 2024-07-11T08:33:06+00:00 category Technologie abstract Un petit tour d'horizon des projets sur lesquels nos équipes techniques travaillent actuellement ... - +author Damien ACCORSI --- { diff --git a/content/posts/post2.md b/content/posts/post2.md index 8e9b54c..f27f03a 100644 --- a/content/posts/post2.md +++ b/content/posts/post2.md @@ -3,6 +3,7 @@ title Microsoft deviendrait-il un spyware avec la fonctionnalité Recall ? date 2024-05-22T12:36:09+00:00 category Technologie abstract Le 20 mai 2024, Microsoft annonce la fonctionnalité Recall qui va "aider les utilisateurs à trouver leurs informations" en s'appuyant sur l'IA ... +author Damien ACCORSI --- { diff --git a/content/posts/post3.md b/content/posts/post3.md index 12f5ae8..2866605 100644 --- a/content/posts/post3.md +++ b/content/posts/post3.md @@ -3,6 +3,7 @@ title Venez échanger sur les sujets de collaboration d'équipe et e-mail aux date 2024-05-20T16:20:03+00:00 category Univers du libre abstract Algoo sera présente et très active aux JDLL 2024 : stand, ateliers et conférence ! +author Damien ACCORSI --- { diff --git a/content/templates/jinja2/post-list.html b/content/templates/jinja2/post-list.html index e0a1620..6d43bd5 100644 --- a/content/templates/jinja2/post-list.html +++ b/content/templates/jinja2/post-list.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html"%} {% block content %}
@@ -6,13 +6,56 @@ Catégories : Tout {% for category in object.categories %} - {{ category }} + {{ category|replace('-', ' ')|title }} {% endfor %}
+
{% for post in object.posts %} - {{ post.timestamp.strftime("%d/%m/%Y") }} : {{ post.title }} : {{ post.metadata.abstract }}
+
+
+
+
+ + +

{{ post.title }}

+
+ +
+

{{ post.metadata.abstract }}

+
+ +
+
+
+
+
{{post.metadata.author}}
+
+ +
+
+
{{ post.timestamp.strftime("%d/%m/%Y") }}
+
+
+ +
+ + Lire la suite ... + +
+
+ +
+
+
+
{% endfor %} +
{% endblock %} \ No newline at end of file diff --git a/content/templates/jinja2/post.html b/content/templates/jinja2/post.html index 3204026..7ba96ce 100644 --- a/content/templates/jinja2/post.html +++ b/content/templates/jinja2/post.html @@ -5,4 +5,5 @@

{{ object.title }}

{{ object.content|safe }} +Tous les posts {% endblock %} diff --git a/jssg/models.py b/jssg/models.py index 1115a35..33f266e 100644 --- a/jssg/models.py +++ b/jssg/models.py @@ -299,7 +299,7 @@ class Sitemap : posts_slugs = [p["slug"] for p in Post.get_posts()] class PostList : - metadata = {} + metadata = {"page_header_h1":"Posts"} category = "" def __init__(self, category = "") -> None: diff --git a/tsconfig.json b/tsconfig.json index 2abd10b..b534021 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,6 +30,12 @@ "@t:jssg/*": [ "./jssg/templates/jssg/*" ], + "@s:django_jinja_markdown/*": [ + "./env/lib/python3.9/site-packages/django_jinja_markdown/static/django_jinja_markdown/*" + ], + "@t:django_jinja_markdown/*": [ + "./env/lib/python3.9/site-packages/django_jinja_markdown/templates/django_jinja_markdown/*" + ], "@s:django_distill/*": [ "./env/lib/python3.9/site-packages/django_distill/static/django_distill/*" ],