Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/appernetic/hugo-nederburg-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Jacobs <aaron@aaronmjacobs.com>2018-06-04 02:17:16 +0300
committerAaron Jacobs <aaron@aaronmjacobs.com>2018-06-04 02:25:32 +0300
commit1a574e6d62870a2521687eb63181eebee5e4ba31 (patch)
tree90a57158f84bd4f4b4f7a0b45a6199b3b15c8f4b /layouts
parentc451729184dc9b78033b130610b1579b48daf81f (diff)
Add support for submenus
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/header.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 6b65f75..324407f 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -20,6 +20,15 @@
{{ range .Site.Menus.main }}
<li id="menu-item" class='menu-item {{ if eq ("/") (.URL) }}menu-item-type-custom menu-item-object-custom{{ else }}menu-item-type-post_type menu-item-object-page{{ end }} {{ if $page.IsMenuCurrent "main" . }}current-menu-item current_page_item{{ end }}'>
<a href="{{ .URL | absURL }}">{{ .Name }}</a>
+ {{ if .HasChildren }}
+ <ul class="sub-menu">
+ {{ range .Children }}
+ <li id="menu-item" class='menu-item {{ if eq ("/") (.URL) }}menu-item-type-custom menu-item-object-custom{{ else }}menu-item-type-post_type menu-item-object-page{{ end }} {{ if $page.IsMenuCurrent "main" . }}current-menu-item current_page_item{{ end }}'>
+ <a href="{{ .URL | absURL }}">{{ .Name }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ end }}
</li>
{{ end }}
</ul>