docs: fix broken links

This commit is contained in:
Johannes Kirschbauer
2025-10-05 13:59:50 +02:00
parent 75c8feb42a
commit 359582118c
5 changed files with 9 additions and 7 deletions

View File

@@ -32,7 +32,9 @@ def help_hyperlink(description: str, url: str) -> str:
def docs_hyperlink(description: str, url: str) -> str:
"""Returns a markdown hyperlink"""
url = url.replace("https://docs.clan.lol", "/")
# Attention: this code assumes the URL maps directly to the filetree structure of the docs
# We should probably enforce this
url = url.replace("https://docs.clan.lol", "../..")
url = url.replace("index.html", "index")
url += ".md"
return f"[{description}]({url})"