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:
-rw-r--r--.gitlab/merge_request_templates/Release.md1
-rw-r--r--content/robots.txt.erb16
2 files changed, 9 insertions, 8 deletions
diff --git a/.gitlab/merge_request_templates/Release.md b/.gitlab/merge_request_templates/Release.md
index 9d501950..a5f98e2a 100644
--- a/.gitlab/merge_request_templates/Release.md
+++ b/.gitlab/merge_request_templates/Release.md
@@ -5,7 +5,6 @@
- [ ] Edit `content/_data/versions.yaml` and rotate the versions
- [ ] Edit `Dockerfile.master` and rotate the versions
- [ ] Edit `dockerfiles/Dockerfile.archives` and add the new version
-- [ ] Add the latest version to `content/robots.txt.erb` to disallow bots (prevent from indexing)
- [ ] \(Optional) Rerun the stable version pipeline if there are changes in the docs after the Docker image was created
- [ ] Merge and manually run the [scheduled pipeline](https://gitlab.com/gitlab-com/gitlab-docs/pipeline_schedules).
diff --git a/content/robots.txt.erb b/content/robots.txt.erb
index cb837894..afeacaad 100644
--- a/content/robots.txt.erb
+++ b/content/robots.txt.erb
@@ -6,13 +6,15 @@ is_hidden: true
sitemap: https://docs.gitlab.com/sitemap.xml
user-agent: *
disallow: /ce/
-disallow: /11.0/
-disallow: /10.8/
-disallow: /10.7/
-disallow: /10.6/
-disallow: /10.5/
-disallow: /10.4/
-disallow: /10.3/
+<% @items['/_data/versions.yaml'][:current].each do |version| %>
+disallow: /<%= version %>/
+<% end %>
+<% @items['/_data/versions.yaml'][:previous].each do |version| %>
+disallow: /<%= version %>/
+<% end %>
+<% @items['/_data/versions.yaml'][:offline].each do |version| %>
+disallow: /<%= version %>/
+<% end %>
<% else %>
# Ban all spiders from the entire site when not on master branch
user-agent: *