aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/menu-hugo.html
blob: 02391ae83d34a1db30c2fcfb639ebcd232f7156b (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
<!--
  This is template for hugo menus, accepts MenuEntity as context
  https://gohugo.io/variables/menus/
-->
{{ if . }}
  {{ template "book-menu-hugo" . }}
{{ end }}

{{ define "book-menu-hugo" }}
<ul>
  {{ range . }}
  <li>
    <a href="{{ .URL }}" {{ if not .Page }}target="_blank" rel="noopener"{{ end }}>
      {{- .Pre -}}
      {{ with .Page }}
        {{ partial "docs/title" .Page }}
      {{ else }}
        {{ .Name }}
      {{ end }}
      {{- .Post -}}
    </a>
    {{- with .Children }}
      {{ template "book-menu-hugo" . }}
    {{- end }}
  </li>
  {{ end }}
</ul>
{{ end }}