From 2930a4f16e2712032185d9e77a9d166b7b40a4e1 Mon Sep 17 00:00:00 2001 From: Victor Boyd <115438604+Victor-Boyd@users.noreply.github.com> Date: Wed, 21 Feb 2024 04:02:15 -0600 Subject: [PATCH] Update doc version warning logic to exclude specific pages This commit modifies the Sphinx template logic to prevent the version warning message from appearing on the 'Contributing to ROS 2 Documentation' page and any pages within the 'Releases' section. The update is aimed at improving user experience by selectively displaying version warnings only where relevant. Additionally, this change addresses and resolves issues #3949 and #3966, which were related to unwanted version warning messages on documentation pages deemed unnecessary for such alerts. - Exclude '/Contributing/Contributing-To-ROS-2-Documentation.html' from version warning messages. - Exclude any pages under '/Releases/' from version warning messages. - Fixes #3949 and #3966. Signed-off-by: Victor Boyd <115438604+Victor-Boyd@users.noreply.github.com> --- source/_templates/page.html | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/source/_templates/page.html b/source/_templates/page.html index 9236eb85d6..b989cc0a29 100644 --- a/source/_templates/page.html +++ b/source/_templates/page.html @@ -21,20 +21,26 @@ {% endblock %} {% block body %} {% if current_version and latest_version and current_version != latest_version %} -

- - {% if current_version.name|string() in eol_versions %} - You're reading the documentation for a version of ROS 2 that has reached its EOL (end-of-life), and is no longer officially supported. - If you want up-to-date information, please have a look at {{latest_version.name | title }}. - {% elif current_version.is_released %} - You're reading the documentation for an older, but still supported, version of ROS 2. - For information on the latest version, please have a look at {{latest_version.name | title }}. - {% else %} - You're reading the documentation for a development version. - For the latest released version, please have a look at {{latest_version.name | title }}. - {% endif %} - -

+ {% set skip_message = False %} + {% if pagename == 'Contributing/Contributing-To-ROS-2-Documentation' or 'Releases/' in pagename %} + {% set skip_message = True %} + {% endif %} + {% if not skip_message %} +

+ + {% if current_version.name|string() in eol_versions %} + You're reading the documentation for a version of ROS 2 that has reached its EOL (end-of-life), and is no longer officially supported. + If you want up-to-date information, please have a look at {{latest_version.name | title }}. + {% elif current_version.is_released %} + You're reading the documentation for an older, but still supported, version of ROS 2. + For information on the latest version, please have a look at {{latest_version.name | title }}. + {% else %} + You're reading the documentation for a development version. + For the latest released version, please have a look at {{latest_version.name | title }}. + {% endif %} + +

+ {% endif %} {% endif %} {{ super() }} {% endblock %}%