summaryrefslogtreecommitdiff
path: root/layouts/_partials/menu.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_partials/menu.html')
-rw-r--r--layouts/_partials/menu.html54
1 files changed, 5 insertions, 49 deletions
diff --git a/layouts/_partials/menu.html b/layouts/_partials/menu.html
index ab36f0c..7e9fccd 100644
--- a/layouts/_partials/menu.html
+++ b/layouts/_partials/menu.html
@@ -1,51 +1,7 @@
-{{- /*
-Renders a menu for the given menu ID.
-
-@context {page} page The current page.
-@context {string} menuID The menu ID.
-
-@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
-*/}}
-
-{{- $page := .page }}
-{{- $menuID := .menuID }}
-
-{{- with index site.Menus $menuID }}
- <nav>
+<nav>
<ul class="list-none m-0 p-0">
- {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ {{ range .Site.Params.nav }}
+ <li><a href="{{ .link }}">{{ .name }}</a></li>
+ {{ end }}
</ul>
- </nav>
-{{- end }}
-
-{{- define "_partials/inline/menu/walk.html" }}
- {{- $page := .page }}
- {{- range .menuEntries }}
- {{- $attrs := dict "href" .URL }}
- {{- if $page.IsMenuCurrent .Menu . }}
- {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
- {{- else if $page.HasMenuCurrent .Menu .}}
- {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
- {{- end }}
- {{- $name := .Name }}
- {{- with .Identifier }}
- {{- with T . }}
- {{- $name = . }}
- {{- end }}
- {{- end }}
- <li class="list-none">
- <a
- {{- range $k, $v := $attrs }}
- {{- with $v }}
- {{- printf " %s=%q" $k $v | safeHTMLAttr }}
- {{- end }}
- {{- end -}}
- >{{ $name }}</a>
- {{- with .Children }}
- <ul>
- {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
- </ul>
- {{- end }}
- </li>
- {{- end }}
-{{- end }}
+</nav>