1
0

Rewrite md->html links automatically

This commit is contained in:
Tim Van Baak 2023-09-12 15:14:31 -07:00
parent ed34df0b68
commit 216c7dd7c8

View File

@ -64,6 +64,11 @@ def main():
article.append(page_content)
page.article.replace_with(article)
# Rewrite links with markdown extensions
for a in page.css.select("a[href]"):
if a["href"].endswith(".md"):
a["href"] = a["href"][:-3] + ".html"
# Inject path into the nav
for i in range(len(dirpath.parts)):
a = page.new_tag("a")