summaryrefslogtreecommitdiff
path: root/layouts/partials/menu.html
blob: 15da3f99205c8ccb577d7cd119de4ae39a52e14e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{{- $page := .page }}
{{- $menuID := .menuID }}

{{- with index site.Menus $menuID }}
  <nav>
    <ul>
      {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
    </ul>
  </nav>
{{- end }}

{{- define "partials/inline/menu/walk.html" }}
  {{- $page := .page }}
  {{- range .menuEntries }}
    {{- partial "menu/item.html" (dict "page" $page "item" .) }}      

  {{- end }}
{{- end }}

{{- define "partials/inline/menu/inline.html" }}
  {{- $page := .page }}
  {{- range .menuEntries }}
     <a href="{{ .URL }}"> {{ .Name }}</a>{{- partial "menu/new-or-up.html" (dict "page" ($page.GetPage .URL)) }}
  {{- end }}
{{- end }}