Skip to content

Commit

Permalink
Revert "WIP"
Browse files Browse the repository at this point in the history
This reverts commit 93f86e3.
  • Loading branch information
ssorj committed Jun 19, 2024
1 parent f46cd74 commit f7ca93a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/body.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<body class="{{page.metadata.get('body_class', 'none')}}">
<header>

{{page.path_nav()}}
{{path_nav(page)}}

</header>
<main>
Expand Down
8 changes: 7 additions & 1 deletion config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

site_prefix = os.environ.get("SITE_PREFIX", "")

def path_nav(page):
files = reversed(list(page.ancestors))
links = [f"<a href=\"{site_prefix}{x.url}\">{x.title}</a>" for x in files]

return f"<nav class=\"path-nav\">{''.join(links)}</nav>"

def refdog_object_links(page):
if "links" not in page.metadata:
return ""
Expand All @@ -13,7 +19,7 @@ def refdog_object_links(page):
lines.append("<nav>")

for link in page.metadata["links"]:
lines.append(f"<a href=\"{link['url']}\">{link['name']}</a>")
lines.append(f"<a href=\"{site_prefix}{link['url']}\">{link['name']}</a>")

lines.append("</nav>")
lines.append("</section>")
Expand Down

0 comments on commit f7ca93a

Please sign in to comment.