diff options
author | Sarah German <sgerman@gitlab.com> | 2022-10-05 01:56:11 +0300 |
---|---|---|
committer | David O'Regan <doregan@gitlab.com> | 2022-10-05 01:56:11 +0300 |
commit | 309860fa7bc365106de9c9e8af83b7edf9a1c92b (patch) | |
tree | 2fbce6fce805d4cfc056e2ca58baa897b815ebb7 /lib | |
parent | b16c762757c462214cae0c5abc9cecd1acc1e805 (diff) |
Refactor the archives banner to use versions.json and GitLab UI
Diffstat (limited to 'lib')
-rw-r--r-- | lib/helpers/versions.rb | 4 |
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 |