Tiny fix for certain doc names (#143)

This commit is contained in:
Yuhong Sun 2023-07-07 00:26:15 -07:00 committed by GitHub
parent 7874862902
commit ef48fef62b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,7 +147,13 @@ def iterate_post_batches(
def get_slab_url_from_title_id(base_url: str, title: str, page_id: str) -> str:
"""This is not a documented approach but seems to be the way it works currently
May be subject to change without notification"""
title = title.replace("[", "").replace("]", "").replace(" ", "-").lower()
title = (
title.replace("[", "")
.replace("]", "")
.replace(":", "")
.replace(" ", "-")
.lower()
)
url_id = title + "-" + page_id
return urljoin(urljoin(base_url, "posts/"), url_id)