Add redirect for cloud page

This commit is contained in:
Cody Baker 2022-03-04 11:46:35 -08:00
parent d4cdf04683
commit d312a943b1
2 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@ changelog/2017.md whats-new/changelog/2017.md
changelog/2018.md whats-new/changelog/2018.md
changelog/2019.md whats-new/changelog/2019.md
changelog/index.md whats-new/changelog/index.md
commercial/cloud.md https://clickhouse.com/cloud/
data_types/array.md sql-reference/data-types/array.md
data_types/boolean.md sql-reference/data-types/boolean.md
data_types/date.md sql-reference/data-types/date.md

View File

@ -31,7 +31,12 @@ def build_redirect_html(args, base_prefix, lang, output_dir, from_path, to_path)
from_path.replace('/index.md', '/index.html').replace('.md', '/index.html')
)
target_path = to_path.replace('/index.md', '/').replace('.md', '/')
to_url = f'/{base_prefix}/{lang}/{target_path}'
if target_path[0:7] != 'http://' and target_path[0:8] != 'https://':
to_url = f'/{base_prefix}/{lang}/{target_path}'
else:
to_url = target_path
to_url = to_url.strip()
write_redirect_html(out_path, to_url)