Add support for hugo menus

This commit is contained in:
Alex Shpak
2020-02-12 22:12:41 +01:00
parent 59479b17ac
commit 2088c9a0cb
7 changed files with 56 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
<!--
This is template for hugo menus, accepts MenuEntity as context
https://gohugo.io/variables/menus/
-->
{{ if . }}
<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>
</li>
{{ end }}
</ul>
{{ end }}