Add nav crumbs
This commit is contained in:
parent
6da3c36735
commit
7755f2be31
8
build.py
8
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)
|
||||
|
|
|
@ -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 {
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav><a href="/">~</a>/</nav>
|
||||
<h1>Untitled Page</h1>
|
||||
</header>
|
||||
<main>
|
||||
|
|
Loading…
Reference in New Issue