mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-22 11:29:28 +00:00
29 lines
593 B
HTML
29 lines
593 B
HTML
<!--
|
|
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 }}
|