From b6c761eaa9ee687a0c661e55d2a8b708cfe13f4b Mon Sep 17 00:00:00 2001 From: Youen Date: Wed, 17 May 2023 21:26:03 +0200 Subject: [PATCH] Ajout d'un avertissement quand on consulte une ancienne version ou une version de travail --- source/_templates/page.html | 18 ++++++++++++++++++ source/conf.py | 5 +++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 source/_templates/page.html diff --git a/source/_templates/page.html b/source/_templates/page.html new file mode 100644 index 0000000..5ab4d45 --- /dev/null +++ b/source/_templates/page.html @@ -0,0 +1,18 @@ +{% extends "!page.html" %} +{% block body %} +{% if current_version and latest_version and current_version != latest_version %} +
+

Attention

+

+ {% if current_version.is_released %} + Ceci est une ancienne version de la documentation. + La dernière version est la {{latest_version.name}}. + {% else %} + Ceci est une version en cours de développement. + La dernière version stable est la {{latest_version.name}}. + {% endif %} +

+
+{% endif %} +{{ super() }} +{% endblock %} diff --git a/source/conf.py b/source/conf.py index 82f72ec..b33db6e 100644 --- a/source/conf.py +++ b/source/conf.py @@ -67,5 +67,6 @@ html_theme_options = { # sphinx-multiversion settings smv_branch_whitelist = r'^main$' -smv_tag_whitelist = r'^v[0-9\.]+$' -smv_released_pattern = r'^tags/.*$' +smv_tag_whitelist = r'^v[\d\.]+$' +smv_released_pattern = r'.*tags/v[\d\.]+' +smv_latest_version = 'v1.0.0'