diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-10-22 16:16:54 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-10-22 17:13:30 +0300 |
commit | 337d25608f983bc751a98062b42128d8ed4a14db (patch) | |
tree | 34f87c917e2c46a2277afeb8c04d5980926f6849 | |
parent | 3065b5a6b360abae5adcb71c35a7a061dbe901a2 (diff) |
Use only two versions lists: online and offline
This is the MVC to automate the version release process
-rw-r--r-- | content/_data/versions.yaml | 6 | ||||
-rw-r--r-- | content/archives.html | 8 | ||||
-rw-r--r-- | content/robots.txt.erb | 5 | ||||
-rw-r--r-- | layouts/header.html | 6 |
4 files changed, 13 insertions, 12 deletions
diff --git a/content/_data/versions.yaml b/content/_data/versions.yaml index 051166c6..1906a822 100644 --- a/content/_data/versions.yaml +++ b/content/_data/versions.yaml @@ -1,7 +1,7 @@ -current: +# The first online version should always point to the +# current stable version. +online: - "11.4" - -previous: - "11.3" - "11.2" diff --git a/content/archives.html b/content/archives.html index d4c28814..9df9cd4a 100644 --- a/content/archives.html +++ b/content/archives.html @@ -32,14 +32,18 @@ project, which continuously deploys this content to <a href="/">docs.gitlab.com< <h2 id="latest-released-version">Latest released version <a class="anchor" href="#latest-released-version"></a></h2> The latest released stable version is -<a href='/<%= @items['/_data/versions.yaml'][:current].first %>/'><%= @items['/_data/versions.yaml'][:current].first %></a>. +<a href='/<%= @items['/_data/versions.yaml'][:online].first %>/'><%= @items['/_data/versions.yaml'][:online].first %></a>. <h2 id="previously-released-versions">Previously released versions <a class="anchor" href="#previously-released-versions"></a></h2> The following versions are available online: <ul> -<% @items['/_data/versions.yaml'][:previous].each do |version| %> +<!-- + List the online versions dropping the first and starting from the second one, + since the first is always the current and we list it in the previous section. +--> +<% @items['/_data/versions.yaml'][:online].drop(1).each do |version| %> <li> <a href='/<%= version %>/'><%= version %></a> </li> diff --git a/content/robots.txt.erb b/content/robots.txt.erb index 567fd52f..8dbe5ba5 100644 --- a/content/robots.txt.erb +++ b/content/robots.txt.erb @@ -7,10 +7,7 @@ sitemap: https://docs.gitlab.com/sitemap.xml user-agent: * disallow: /ce/ disallow: /debug/ -<% @items['/_data/versions.yaml'][:current].each do |version| %> -disallow: /<%= version %>/ -<% end %> -<% @items['/_data/versions.yaml'][:previous].each do |version| %> +<% @items['/_data/versions.yaml'][:online].each do |version| %> disallow: /<%= version %>/ <% end %> <% @items['/_data/versions.yaml'][:offline].each do |version| %> diff --git a/layouts/header.html b/layouts/header.html index c73af613..2ce795ee 100644 --- a/layouts/header.html +++ b/layouts/header.html @@ -24,11 +24,11 @@ </li> <li role="separator" class="divider"></li> <li> - <a href='/<%= @items['/_data/versions.yaml'][:current].first %><%= @item.identifier.without_ext + '.html' %>'> - <%= @items['/_data/versions.yaml'][:current].first %> + <a href='/<%= @items['/_data/versions.yaml'][:online].first %><%= @item.identifier.without_ext + '.html' %>'> + <%= @items['/_data/versions.yaml'][:online].first %> </a> </li> - <% @items['/_data/versions.yaml'][:previous].each do |version| %> + <% @items['/_data/versions.yaml'][:online].drop(1).each do |version| %> <li> <a href='/<%= version %><%= @item.identifier.without_ext + '.html' %>'> <%= version %> |