# Where to define menus?

**URL:** <https://discourse.gohugo.io/t/where-to-define-menus/159>\
**Category:** support\
**Created:** [October 2, 2014, 2:55pm UTC](https://discourse.gohugo.io/t/where-to-define-menus/159 "2014-10-02T14:55:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![oscar\_b](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/oscar_b/32/40_2.png) [@oscar\_b](https://discourse.gohugo.io/u/oscar_b)\
**Post date:** [October 2, 2014, 5:06pm UTC](https://discourse.gohugo.io/t/where-to-define-menus/159/5 "2014-10-02T17:06:51Z")

</div>

Make sure you read [http://discuss.gohugo.io/t/intro-to-toml/42/4](http://discuss.gohugo.io/t/intro-to-toml/42/4), it has some useful information about TOML that took me a while to figure out.

In the front matter of each content page you want in the menu, I have something like this:

```auto
+++
date = "2014-09-18T21:51:13+02:00"
title = "About Us"
[menu.main]
name = "About"
weight = 4
+++

```

One important thing to remember is that all table definitions in TOML needs to be _last_, since it just keeps adding variables that appears until the end or until the next table definition. If `name` in `[menu.main]` is left out, it will use the page title. `weight` is for determining the order of your menu items.

Then my `partials/nav.html`is something like this:

```auto
<nav>
	<ul>
		{{ range .Site.Menus.main }}
		<li><a href="{{ .Url }}">{{ .Name }}</a></li>
		{{end}}
	</ul>
</nav>

```

---

_[View the full topic](https://discourse.gohugo.io/t/where-to-define-menus/159)._
