Add support for hugo menus
This commit is contained in:
@@ -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 }}
|
||||
@@ -1,7 +1,9 @@
|
||||
<nav>
|
||||
{{ partial "docs/brand" . }}
|
||||
{{ partial "docs/search" . }}
|
||||
|
||||
{{ partial "docs/inject/menu-before" . }}
|
||||
{{ partial "docs/menu-hugo" .Site.Menus.before }}
|
||||
|
||||
{{ if .Site.Params.BookMenuBundle }}
|
||||
{{ partial "docs/menu-bundle" . }}
|
||||
@@ -9,6 +11,7 @@
|
||||
{{ partial "docs/menu-filetree" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "docs/menu-hugo" .Site.Menus.after }}
|
||||
{{ partial "docs/inject/menu-after" . }}
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<!--
|
||||
Partial to generate page name from Title or File name.
|
||||
Accepts Page as context
|
||||
-->
|
||||
{{ $title := "" }}
|
||||
|
||||
{{ if .Title }}
|
||||
|
||||
Reference in New Issue
Block a user