Skip to content
代码片段 群组 项目
提交 f8b8f574 编辑于 作者: Sarah German's avatar Sarah German
浏览文件

Add handling for docs navigation file move

上级 22afb07d
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
......@@ -55,10 +55,22 @@ def docs_path
def navigation_file
@navigation_file ||= begin
url = URI('https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/raw/main/data/navigation.yaml')
# Temporary handling for multiple navigation locations.
# The navigation YAML file will move when this merges:
# https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/merge_requests/307.
#
# We are not able to control these changes merging at exactly the same time,
# so this temporarily supports both the new and old file location.
url = URI('https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/raw/main/data/en-us/navigation.yaml')
response = Net::HTTP.get_response(url)
raise "Could not download navigation.yaml. Response code: #{response.code}" if response.code != '200'
# If new URL fails, try the old URL
if response.code != '200'
url = URI('https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/raw/main/data/navigation.yaml')
response = Net::HTTP.get_response(url)
raise "Could not download navigation.yaml. Response code: #{response.code}" if response.code != '200'
end
# response.body should be memoized in a method, so that it doesn't
# need to be downloaded multiple times in one CI job.
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册