Browse Source

Ajout d'un avertissement quand on consulte une ancienne version ou une version de travail

main
Youen 2 years ago
parent
commit
b6c761eaa9
  1. 18
      source/_templates/page.html
  2. 5
      source/conf.py

18
source/_templates/page.html

@ -0,0 +1,18 @@
{% extends "!page.html" %}
{% block body %}
{% if current_version and latest_version and current_version != latest_version %}
<div class="warning admonition">
<p class="admonition-title">Attention</p>
<p>
{% if current_version.is_released %}
Ceci est une ancienne version de la documentation.
La dernière version est la <a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>.
{% else %}
Ceci est une version en cours de développement.
La dernière version stable est la <a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>.
{% endif %}
</p>
</div>
{% endif %}
{{ super() }}
{% endblock %}

5
source/conf.py

@ -67,5 +67,6 @@ html_theme_options = {
# sphinx-multiversion settings # sphinx-multiversion settings
smv_branch_whitelist = r'^main$' smv_branch_whitelist = r'^main$'
smv_tag_whitelist = r'^v[0-9\.]+$' smv_tag_whitelist = r'^v[\d\.]+$'
smv_released_pattern = r'^tags/.*$' smv_released_pattern = r'.*tags/v[\d\.]+'
smv_latest_version = 'v1.0.0'

Loading…
Cancel
Save