--- title: ByWeight description: Returns the given menu with its entries sorted by weight, then by name, then by identifier. categories: [] keywords: [] action: related: [] returnType: navigation.Menu signatures: [MENU.ByWeight] --- The `ByWeight` method returns the given menu with its entries sorted by [`weight`], then by `name`, then by `identifier`. This is the default sort order. [`weight`]: /getting-started/glossary/#weight Consider this menu definition: {{< code-toggle file=hugo >}} [[menus.main]] identifier = 'about' name = 'About' pageRef = '/about' weight = 20 [[menus.main]] identifier = 'services' name = 'Services' pageRef = '/services' weight = 10 [[menus.main]] identifier = 'contact' name = 'Contact' pageRef = '/contact' weight = 30 {{< /code-toggle >}} To sort the entries by `weight`, then by `name`, then by `identifier`: ```go-html-template