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
path: root/lib
diff options
context:
space:
mode:
authorSarah German <sgerman@gitlab.com>2022-10-05 01:56:11 +0300
committerDavid O'Regan <doregan@gitlab.com>2022-10-05 01:56:11 +0300
commit309860fa7bc365106de9c9e8af83b7edf9a1c92b (patch)
tree2fbce6fce805d4cfc056e2ca58baa897b815ebb7 /lib
parentb16c762757c462214cae0c5abc9cecd1acc1e805 (diff)
Refactor the archives banner to use versions.json and GitLab UI
Diffstat (limited to 'lib')
-rw-r--r--lib/helpers/versions.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/helpers/versions.rb b/lib/helpers/versions.rb
index ea98b966..954ea6ca 100644
--- a/lib/helpers/versions.rb
+++ b/lib/helpers/versions.rb
@@ -18,7 +18,9 @@ module Nanoc::Helpers
# Check if the current version is the latest.
#
def latest?
- latest_version = @items['/_data/versions.yaml'][:online][0]
+ file = File.read('./content/versions.json')
+ parsed = JSON.parse(file)
+ latest_version = parsed[0]['current']
ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] || ENV['CI_COMMIT_REF_NAME'] == latest_version
end