diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-02 09:11:17 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-02 09:11:17 +0800 |
commit | 5fdc3e6ae9f688dfdbae8c99669ba5427b2dee78 (patch) | |
tree | 06ed7cb765bcd5f0405b6af8c128e8d04ba80741 /layouts | |
parent | Update layouts (diff) | |
download | website-5fdc3e6ae9f688dfdbae8c99669ba5427b2dee78.tar.gz website-5fdc3e6ae9f688dfdbae8c99669ba5427b2dee78.tar.zst website-5fdc3e6ae9f688dfdbae8c99669ba5427b2dee78.zip |
Add actual navbar
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 33f8136..6f55b57 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,6 +9,30 @@ </head> <body> <aside id="sidebar"> + <p style="text-align: center; font-weight: bold;"> + <a href="/">{{ .Site.Title }}</a> + </p> + {{ $currentSection := .CurrentSection }} + <ul> + {{ range .Site.Sections }} + {{ if eq $currentSection . }} + <li class="nav-current"><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ else }} + <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ end }} + {{ if or (eq $currentSection .) ($currentSection.IsDescendant .) }} + <ul> + {{ range .Pages }} + {{ if eq $currentSection . }} + <li class="nav-current"><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ else }} + <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ end }} + {{ end }} + </ul> + {{ end }} + {{ end }} + </ul> </aside> <div id="main-and-footer"> <main> |