Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2021-06-16 13:03:01 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2021-06-16 13:03:01 +0300
commit2b7b292dda4a041031ac437172894be7c989e458 (patch)
tree2e5368a0e9181ececc399b9ac4c4c5dcb852cc92
parentd644a6a605af4bde42d4512ddb0d6a92531acd43 (diff)
parent8f55be2e68139e35b84addfddab85de86267b30c (diff)
Merge branch 'cherry-pick-7e101894-2' into '13.11'
Backport dropdown fix to 13.11 See merge request gitlab-org/gitlab-docs!1882
-rw-r--r--content/_data/versions.yaml4
-rw-r--r--lib/helpers/versions.rb15
2 files changed, 17 insertions, 2 deletions
diff --git a/content/_data/versions.yaml b/content/_data/versions.yaml
index 2fb626e1..adf66943 100644
--- a/content/_data/versions.yaml
+++ b/content/_data/versions.yaml
@@ -11,6 +11,10 @@ online:
- "13.11"
- "13.10"
+# The last version before the next major release
+last_before_new_major:
+ - "13.12"
+
# Versions not appearing in the dropdown, but available as Docker images
# https://docs.gitlab.com/archives/#offline-archives
offline:
diff --git a/lib/helpers/versions.rb b/lib/helpers/versions.rb
index 014a1c0a..e467c43f 100644
--- a/lib/helpers/versions.rb
+++ b/lib/helpers/versions.rb
@@ -63,9 +63,20 @@ module Nanoc::Helpers
def next_version
latest_stable = data_versions[:online].first
- next_major, next_minor = latest_stable.split('.')
+ latest_major, latest_minor = latest_stable.split('.')
+ _, last_minor = data_versions[:last_before_new_major].first.split('.')
- "#{next_major}.#{next_minor.to_i + 1}"
+ #
+ # If the minor version of the latest online version
+ # is equal to last_minor, bump the major version
+ # and set patch to 0. This is for the case where a new
+ # major version is the next version to be released.
+ #
+ if latest_minor == last_minor
+ "#{latest_major.to_i + 1}.0"
+ else
+ "#{latest_major}.#{latest_minor.to_i + 1}"
+ end
end
def dotcom