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