From 216c7dd7c8fd44b238b7ef842a1456e0e95085d9 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 12 Sep 2023 15:14:31 -0700 Subject: [PATCH] Rewrite md->html links automatically --- build.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.py b/build.py index ea06fab..b5ca299 100755 --- a/build.py +++ b/build.py @@ -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")