From aed90fcfedd1bce7aea3d75adb0eed8587388bd5 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Tue, 11 Mar 2025 17:17:43 +0000 Subject: [PATCH] [FIX] core: list versions in descending order in the version switcher closes odoo/documentation#12377 X-original-commit: 344228852e7ccd362219c9dd31bd19222dc90117 Signed-off-by: Antoine Vandevenne (anv) --- conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index 06c4d35cd..c815aacaf 100644 --- a/conf.py +++ b/conf.py @@ -227,8 +227,8 @@ sphinx.transforms.i18n.docname_to_domain = ( sphinx.util.i18n.docname_to_domain ) = lambda docname, compact: docname.split('/')[1 if docname.startswith('applications/') else 0] -# The version names that should be shown in the version switcher, if the config option `versions` -# is populated. +# The labels used in the version switcher to show the versions provided with the `versions` config +# option. If a provided version has no label, the version string is used as label. versions_names = { 'master': "Master", 'saas-18.2': "Odoo 18.2", @@ -239,8 +239,8 @@ versions_names = { '16.0': "Odoo 16", } -# The language names that should be shown in the language switcher, if the config option `languages` -# is populated. +# The labels used in the language switcher to show the languages provided with the `languages` +# config option. If a provided language code has no label, the upper-cased code is used as label. languages_names = { 'de': 'DE', 'en': 'EN', @@ -458,7 +458,7 @@ def _generate_alternate_urls(app, pagename, templatename, context, doctree): # Map alternate versions to their display names and URLs. context['alternate_versions'] = [] - for alternate_version_ in provided_versions_: + for alternate_version_ in reversed(provided_versions_): # Reverse to show latest first. if alternate_version_ != version: display_name_ = versions_names.get(alternate_version_, alternate_version_) context['alternate_versions'].append((display_name_, build_url(alternate_version_)))