summaryrefslogtreecommitdiff
path: root/layouts/partials/menu.html
blob: f70ac28153a3d923177089e6df768b0cdc022077 (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
27
28
29
30
31
32
33
34
{{- $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 }}
    {{- $pageItem := $page.GetPage .URL}}
    {{- if $pageItem.Params.menu_item_override }}
      <a href="{{ .URL }}">{{ $pageItem.Params.menu_item_override }}</a>
   {{- else}}
     <a href="{{ .URL }}"> {{ .Name }}</a>
   {{- end }}

     {{- partial "menu/new-or-up.html" (dict "page" ($pageItem)) }}
     
  {{- end }}
{{- end }}