From 0ffb2af7f353033eb9cf84f7ff9383e93f4e7cba Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 12 Apr 2022 17:56:11 +0200 Subject: Skip adding external domains to Pages redirects --- Rakefile | 5 +++++ 1 file changed, 5 insertions(+) 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)}" -- cgit v1.2.3