mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-22 03:19:25 +00:00
#150, Add support for menu nesting (before, after menus)
This commit is contained in:
parent
59b649cf8b
commit
8369d9a3a7
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
menu:
|
menu:
|
||||||
after:
|
after:
|
||||||
|
name: blog
|
||||||
weight: 5
|
weight: 5
|
||||||
title: Blog
|
title: Blog
|
||||||
---
|
---
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
https://gohugo.io/variables/menus/
|
https://gohugo.io/variables/menus/
|
||||||
-->
|
-->
|
||||||
{{ if . }}
|
{{ if . }}
|
||||||
|
{{ template "book-menu-hugo" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ define "book-menu-hugo" }}
|
||||||
<ul>
|
<ul>
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
<li>
|
<li>
|
||||||
@ -15,6 +19,9 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{- .Post -}}
|
{{- .Post -}}
|
||||||
</a>
|
</a>
|
||||||
|
{{- with .Children }}
|
||||||
|
{{ template "book-menu-hugo" . }}
|
||||||
|
{{- end }}
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user