Merge pull request #35061 from flickerbox/crb-add-cloud-redirect

Add redirect for cloud page
This commit is contained in:
alexey-milovidov 2022-03-05 01:08:00 +03:00 committed by GitHub
commit b46b65ab06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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/2018.md whats-new/changelog/2018.md
changelog/2019.md whats-new/changelog/2019.md changelog/2019.md whats-new/changelog/2019.md
changelog/index.md whats-new/changelog/index.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/array.md sql-reference/data-types/array.md
data_types/boolean.md sql-reference/data-types/boolean.md data_types/boolean.md sql-reference/data-types/boolean.md
data_types/date.md sql-reference/data-types/date.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') from_path.replace('/index.md', '/index.html').replace('.md', '/index.html')
) )
target_path = to_path.replace('/index.md', '/').replace('.md', '/') target_path = to_path.replace('/index.md', '/').replace('.md', '/')
if target_path[0:7] != 'http://' and target_path[0:8] != 'https://':
to_url = f'/{base_prefix}/{lang}/{target_path}' to_url = f'/{base_prefix}/{lang}/{target_path}'
else:
to_url = target_path
to_url = to_url.strip() to_url = to_url.strip()
write_redirect_html(out_path, to_url) write_redirect_html(out_path, to_url)