diff --git a/doc/build-versioned-docs.sh b/doc/build-versioned-docs.sh index 4d346271838..77225086514 100755 --- a/doc/build-versioned-docs.sh +++ b/doc/build-versioned-docs.sh @@ -20,7 +20,7 @@ cd doc # Get a list of languages based on the folders in locales languages="en `find locales/ -mindepth 1 -maxdepth 1 -type d -exec basename '{}' \;`" # Get a list of tags, excluding those before v1.0.0 -versions="`git for-each-ref '--format=%(refname:lstrip=-1)' refs/tags/ | grep -iE '^v((([1-9]|[0-9]{2,}).*\.([5-9]|[0-9]{2,}).*)|([2-9]|[0-9]{2,}).*)$'`" +versions="`git for-each-ref '--format=%(refname:lstrip=-1)' refs/tags/ | grep -iE '^v((([1-9]|[0-9]{2,}).*\.([8-9]|[0-9]{2,}).*)|([2-9]|[0-9]{2,}).*)$'`" for current_version in ${versions}; do diff --git a/doc/source/conf.py b/doc/source/conf.py index 521bf03370a..489e141eeca 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -63,11 +63,14 @@ # Make version list accessible for the html templates html_context["versions"] = list() -versions = [ - tag.name - for tag in repo.tags - if int(tag.name[1]) > 0 and int(tag.name.split(".")[1]) >= 5 -] +versions = sorted( + [ + tag.name + for tag in repo.tags + if int(tag.name[1]) > 0 and int(tag.name.split(".")[1]) >= 8 + ], + key=lambda x: [int(part) for part in x[1:].split(".")], +) versions.append("main") for version in versions: html_context["versions"].append({"name": version})