Hi all
Just fired up Hugo for the first time. I’m sure this question is stupid but how do I create a custom menu from a front-matter?
In the example below the menu named nav
doesn’t print, but the sites
menu workes fine.
config.toml:
baseURL = "/"
title = "Design"
theme = "regionhalland"
description = "Kube is a professional and a responsive Hugo theme for developers and designers that offers a documentation section mixed with a landing page and a blog"
[Params]
RSSLink = "/index.xml"
author = "Region Halland" # add your company name
github = "RegionHalland" # add your github profile name
twitter = "@regionhalland" # add your twitter profile
email = "joel.sanden@regionhalland.se"
[menu]
[[menu.sites]]
identifier = "arkitektur"
name = "Arkitektur"
url = "//arkitektur.regionhalland.se"
weight = -110
[[menu.sites]]
identifier = "stil"
name = "Stilguide"
url = "/stilguide"
weight = -100
header.html
<nav>
<ul>
{{ range .Site.Menus.sites }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</nav>
<nav>
<ul>
{{ range .Site.Menus.nav }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</nav>
some content:
---
title: "Hello!"
date: 2019-01-14T10:50:57+01:00
draft: true
menu:
nav:
---
# This is it!
Some content