# Documentation of built-in menu methods

**URL:** https://discourse.gohugo.io/t/documentation-of-built-in-menu-methods/30982
**Category:** support
**Created:** [February 1, 2021, 10:52am UTC](https://discourse.gohugo.io/t/documentation-of-built-in-menu-methods/30982 "2021-02-01T10:52:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fridde](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/fridde/32/13112_2.png) [@fridde](https://discourse.gohugo.io/u/fridde)
#### Post date: [February 1, 2021, 10:52am UTC](https://discourse.gohugo.io/t/documentation-of-built-in-menu-methods/30982/1 "2021-02-01T10:52:36Z")

</div>

This is a beginner’s question that may just be related to Go and not Hugo, but I can’t tell the difference.

While browsing examples and forum posts I frequently stumble upon seemingly built-in functions, variables or methods that I can’t find any documentation about using my average google skills.

The latest example was a menu template someone had created and they had used `range .Site.Menus.main.ByName`. Interesting, I thought. I didn’t know I could do that.

Trying to find out how “ByName” works and what other functions exist that could be helpful while building my menus, I felt like I am missing out on some secret club where people just whisper hidden Hugo functionality to each other. In the end I had to read the Hugo source code.

Is the simple answer that someone wrote this functionality without documenting it? Is there a automated hierarchical API documentation somewhere?

---

<div class="post-metadata">

### Author: ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)
#### Post date: [February 1, 2021, 11:31am UTC](https://discourse.gohugo.io/t/documentation-of-built-in-menu-methods/30982/2 "2021-02-01T11:31:03Z")

</div>

> [@fridde](#):
>
> Is the simple answer that someone wrote this functionality without documenting it?

There is documentation about methods one can use to [order content](https://gohugo.io/templates/lists#order-content).

However, when it comes to ordering Menu items, the only available info is from the following [post](https://discourse.gohugo.io/t/ordering-menu-items/1841/4) right here in this forum:

> [@Ordering Menu Items](https://discourse.gohugo.io/t/ordering-menu-items/1841/4):
>
> For menu items there are no concept of date. You can sort ByWeight and ByName.

Searching this forum and the Hugo Documentation is better than searching the World Wide Web.

Also if you feel that this needs to be included in the Documentation you can open an issue at the [Hugo Docs](https://github.com/gohugoio/hugoDocs/) repository.

---

<div class="post-metadata">

### Author: ![fridde](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/fridde/32/13112_2.png) [@fridde](https://discourse.gohugo.io/u/fridde)
#### Post date: [February 3, 2021, 8:00am UTC](https://discourse.gohugo.io/t/documentation-of-built-in-menu-methods/30982/3 "2021-02-03T08:00:58Z")

</div>

Thank you! And sorry for not getting back earlier.

> [@alexandros](#):
>
> Searching this forum and the Hugo Documentation is better than searching the World Wide Web.

This was my main concern. I see that there is yet no way of walking down a reference automagically created from comment structures, like those created by doxygen, javadoc or phpdoc.

But it’s good to know that I haven’t missed any important way of learning about Hugo functionality.

---

<div class="post-metadata">

### Author: ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)
#### Post date: [February 4, 2021, 4:00pm UTC](https://discourse.gohugo.io/t/documentation-of-built-in-menu-methods/30982/4 "2021-02-04T16:00:41Z")

</div>

This topic was automatically closed after 44 hours. New replies are no longer allowed.
