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:
authorSarah German <sgerman@gitlab.com>2022-04-22 23:29:31 +0300
committerSarah German <sgerman@gitlab.com>2022-04-22 23:29:31 +0300
commit4ff89a4eb0bcda6e9d81f5741fdaed24935b45c8 (patch)
treee1c185b6634da3ca4a30cd5a7241dfd3750c3344
parente77dbf6ffdf7622392887ee6525802c14242dab4 (diff)
parent0ffb2af7f353033eb9cf84f7ff9383e93f4e7cba (diff)
Merge branch 'axil-dont-add-external-domain-redirects' into 'main'
Skip adding external domains to Pages redirects Closes #1157 See merge request gitlab-org/gitlab-docs!2567
-rw-r--r--Rakefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index c03424d7..0bc6e56b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -356,6 +356,11 @@ namespace :docs do
counter += 1
File.delete(filename) if File.exist?(filename)
+
+ # Don't add any entries that are domain-level redirects, they are not supported
+ # https://docs.gitlab.com/ee/user/project/pages/redirects.html
+ next if new_path(frontmatter['redirect_to'], filename, content_dir, slug).start_with?('http')
+
File.open(redirects_yaml, 'a') do |post|
post.puts " - from: #{old_path}"
post.puts " to: #{new_path(frontmatter['redirect_to'], filename, content_dir, slug)}"