1
0
Fork 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
1 changed files with 5 additions and 0 deletions

View File

@ -64,6 +64,11 @@ def main():
article.append(page_content) article.append(page_content)
page.article.replace_with(article) 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 # Inject path into the nav
for i in range(len(dirpath.parts)): for i in range(len(dirpath.parts)):
a = page.new_tag("a") a = page.new_tag("a")