def get_relative_html_path(old_page, new_page, use_directory_urls):
    """Return the relative path from the old html path to the new html path"""
    old_path = get_html_path(old_page, use_directory_urls)
    new_path = get_html_path(new_page, use_directory_urls)

    if use_directory_urls:
        # remove /index.html from end of path
        new_path = os.path.dirname(new_path)

    relative_path = os.path.relpath(new_path, start=os.path.dirname(old_path))

    if use_directory_urls:
        relative_path = relative_path + "/"

    return relative_path
Return the relative path from the old html path to the new html path
util/mkdocs-redirects/mkdocs-redirects/plugin.py