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:
authorAchilleas Pipinellis <axil@gitlab.com>2022-04-12 18:56:11 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2022-04-12 18:56:11 +0300
commit0ffb2af7f353033eb9cf84f7ff9383e93f4e7cba (patch)
tree385394907619d08c86d63669c6ec1e345b7466cc
parentdce6807f49f6bd13eeca296608eeeba2c99b83ba (diff)
Skip adding external domains to Pages redirectsaxil-dont-add-external-domain-redirects
-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)}"