From 87494ac32344bb8315cb7a50586064d1bfd8a55c Mon Sep 17 00:00:00 2001 From: Emmanuel Godard <emmanuel.godard@lis-lab.fr> Date: Tue, 19 Dec 2023 14:54:31 +0100 Subject: [PATCH] ajout author --- templates/archives.html | 8 ++++++-- templates/article.html | 5 ++++- templates/category.html | 7 ++++++- templates/index.html | 8 ++++++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/templates/archives.html b/templates/archives.html index a7374d7..13b4d4b 100644 --- a/templates/archives.html +++ b/templates/archives.html @@ -8,11 +8,15 @@ <h2>Archives for {{ SITENAME }}</h2> <ul> {% for article in dates %} - <li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a> + <li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} + {% if article.author %} + -- {{ article.author }} + {% endif %} + </a> <time>{{ article.date|strftime('%b %Y') }}</time> </li> {% endfor %} </ul> </section> </main> -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/article.html b/templates/article.html index eaf9762..5f792bd 100644 --- a/templates/article.html +++ b/templates/article.html @@ -13,7 +13,10 @@ {% block content %} <main> <article> - <h1>{{ article.title }}</h1> + <h1>{{ article.title }}</h1> + {% if article.author %} + <h2>{{ article.author }}</h2> + {% endif %} {% import 'translations.html' as translations with context %} {{ translations.translations_for(article) }} <aside> diff --git a/templates/category.html b/templates/category.html index 12c566c..2082ab2 100644 --- a/templates/category.html +++ b/templates/category.html @@ -13,7 +13,12 @@ {% if period != new.p %} <h3>{{ period }}</h3> <li> - <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a> + <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} + {% if article.author %} + -- {{ article.author }} + {% endif %} + + </a> <time>{{ article.date|strftime('%b %Y') }}</time> </li> {% set new.p = article.date | strftime('%Y') %} diff --git a/templates/index.html b/templates/index.html index 30690b3..20c19ad 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,8 +6,12 @@ <ul> {% for article in articles_page.object_list %} <li> - <h1><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" - title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h1> + <h2><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" + title="Permalink to {{ article.title|striptags }}">{{ article.title }} + {% if article.author %} + -- {{ article.author }} + {% endif %} + </a></h2> <aside> <ul> <li> -- GitLab