hugo-book/layouts/partials/docs/menu-hugo.html

29 lines
593 B
HTML
Raw Normal View History

2020-02-12 21:12:41 +00:00
<!--
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" }}
2020-02-12 21:12:41 +00:00
<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 }}
2020-02-12 21:12:41 +00:00
</li>
{{ end }}
</ul>
{{ end }}