From 7755f2be31df8ac6ce892025653c96d354062f75 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Mon, 11 Sep 2023 17:26:56 -0700 Subject: [PATCH] Add nav crumbs --- build.py | 8 ++++++++ src/.template.html | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index b6e4c4e..13cd7a8 100755 --- a/build.py +++ b/build.py @@ -65,6 +65,14 @@ def main(): article.append(page_content) page.article.replace_with(article) + # Inject path into the nav + for i in range(len(dirpath.parts)): + a = page.new_tag("a") + a["href"] = "/" + "/".join(dirpath.parts[:i+1]) + "/" + a.string = dirpath.parts[i] + page.nav.append(a) + page.nav.append(page.new_string("/")) + # Apply metadata to the template if meta_title := meta.get("title"): title = "".join(meta_title) diff --git a/src/.template.html b/src/.template.html index 4a0922c..b110dd1 100644 --- a/src/.template.html +++ b/src/.template.html @@ -7,9 +7,13 @@ body { max-width: 100ch; margin: 0 auto; - padding: 2em; + padding: 1em 2em; line-height: 1.4em; } +nav { + font-size: 1.2em; + font-family: monospace; +} :target { background: palegoldenrod; } @@ -22,6 +26,7 @@ header::after {
+

Untitled Page