How to create custom menus?

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

Hi,

This is how you add content to a menu using its front matter: https://gohugo.io/content-management/menus/#add-content-to-menus

So, probably something like below as a simple case:

menu: "nav"
1 Like

There is no stupid question. But here are some good answers:

There’s also “Build Static Sites in Seconds with Hugo” from Udemy.

Thanks! Problem solved. It was probably some cache issue… works fine now!