Documentation of built-in menu methods

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?

There is documentation about methods one can use to order content.

However, when it comes to ordering Menu items, the only available info is from the following post right here in this forum:

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 repository.

Thank you! And sorry for not getting back earlier.

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.

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