Update build.py

This commit is contained in:
Ivan Blinkov 2020-05-03 20:06:31 +03:00 committed by GitHub
parent 5d7fd78247
commit b497f99e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -332,7 +332,7 @@ def build_redirect_html(args, from_path, to_path):
from_path.replace('/index.md', '/index.html').replace('.md', '/index.html')
)
version_prefix = f'/{args.version_prefix}/' if args.version_prefix else '/'
target_path = to_path.replace('.md', '/')
target_path = to_path.replace('/index.md', '/').replace('.md', '/')
to_url = f'/docs{version_prefix}{lang}/{target_path}'
to_url = to_url.strip()
write_redirect_html(out_path, to_url)