Rewrite md->html links automatically
This commit is contained in:
parent
ed34df0b68
commit
216c7dd7c8
5
build.py
5
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")
|
||||
|
Loading…
Reference in New Issue
Block a user