summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-02 11:14:24 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-02 11:14:24 +0800
commita70083fb23ad51dde285d55b6792beab4021fc89 (patch)
tree52c33668b50c8b8858da782f640d5fc752bc6802 /layouts/_default
parentFix nav state (diff)
downloadwebsite-a70083fb23ad51dde285d55b6792beab4021fc89.tar.gz
website-a70083fb23ad51dde285d55b6792beab4021fc89.tar.zst
website-a70083fb23ad51dde285d55b6792beab4021fc89.zip
Recursive navigation
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/baseof.html22
1 files changed, 1 insertions, 21 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 3fbc126..c6e0e3b 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -12,27 +12,7 @@
<p style="text-align: center; font-weight: bold;">
<a href="/">{{ .Site.Title }}</a>
</p>
- {{ $currentPage := . }}
- <ul>
- {{ range .Site.Sections }}
- {{ if eq $currentPage . }}
- <li class="nav-current"><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
- {{ else }}
- <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
- {{ end }}
- {{ if or (eq $currentPage .) ($currentPage.IsDescendant .) }}
- <ul>
- {{ range .Pages }}
- {{ if eq $currentPage . }}
- <li class="nav-current"><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
- {{ else }}
- <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
- {{ end }}
- {{ end }}
- </ul>
- {{ end }}
- {{ end }}
- </ul>
+ {{ partial "recursive_nav.html" (dict "currentPage" . "pages" .Site.Sections) }}
</aside>
<div id="main-and-footer">
<main>