<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Menu methods on Hugo</title><link>https://v0-122-0--gohugoio.netlify.app/methods/menu/</link><description>Recent content in Menu methods on Hugo</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://v0-122-0--gohugoio.netlify.app/methods/menu/index.xml" rel="self" type="application/rss+xml"/><item><title>ByName</title><link>https://v0-122-0--gohugoio.netlify.app/methods/menu/byname/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/methods/menu/byname/</guid><description>The Sort method returns the given menu with its entries sorted by name.
Consider this menu definition:
hugo. yaml &amp;nbsp; toml &amp;nbsp; json &amp;nbsp; menus: main: - name: Services pageRef: /services weight: 10 - name: About pageRef: /about weight: 20 - name: Contact pageRef: /contact weight: 30 [menus] [[menus.main]] name = &amp;#39;Services&amp;#39; pageRef = &amp;#39;/services&amp;#39; weight = 10 [[menus.main]] name = &amp;#39;About&amp;#39; pageRef = &amp;#39;/about&amp;#39; weight = 20 [[menus.main]] name = &amp;#39;Contact&amp;#39; pageRef = &amp;#39;/contact&amp;#39; weight = 30 { &amp;#34;menus&amp;#34;: { &amp;#34;main&amp;#34;: [ { &amp;#34;name&amp;#34;: &amp;#34;Services&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/services&amp;#34;, &amp;#34;weight&amp;#34;: 10 }, { &amp;#34;name&amp;#34;: &amp;#34;About&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/about&amp;#34;, &amp;#34;weight&amp;#34;: 20 }, { &amp;#34;name&amp;#34;: &amp;#34;Contact&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/contact&amp;#34;, &amp;#34;weight&amp;#34;: 30 } ] } } To sort the entries by name:</description></item><item><title>ByWeight</title><link>https://v0-122-0--gohugoio.netlify.app/methods/menu/byweight/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/methods/menu/byweight/</guid><description>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.
Consider this menu definition:
hugo. yaml &amp;nbsp; toml &amp;nbsp; json &amp;nbsp; menus: main: - identifier: about name: About pageRef: /about weight: 20 - identifier: services name: Services pageRef: /services weight: 10 - identifier: contact name: Contact pageRef: /contact weight: 30 [menus] [[menus.main]] identifier = &amp;#39;about&amp;#39; name = &amp;#39;About&amp;#39; pageRef = &amp;#39;/about&amp;#39; weight = 20 [[menus.</description></item><item><title>Limit</title><link>https://v0-122-0--gohugoio.netlify.app/methods/menu/limit/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/methods/menu/limit/</guid><description>The Limit method returns the given menu, limited to the first N entries.
Consider this menu definition:
hugo. yaml &amp;nbsp; toml &amp;nbsp; json &amp;nbsp; menus: main: - name: Services pageRef: /services weight: 10 - name: About pageRef: /about weight: 20 - name: Contact pageRef: /contact weight: 30 [menus] [[menus.main]] name = &amp;#39;Services&amp;#39; pageRef = &amp;#39;/services&amp;#39; weight = 10 [[menus.main]] name = &amp;#39;About&amp;#39; pageRef = &amp;#39;/about&amp;#39; weight = 20 [[menus.main]] name = &amp;#39;Contact&amp;#39; pageRef = &amp;#39;/contact&amp;#39; weight = 30 { &amp;#34;menus&amp;#34;: { &amp;#34;main&amp;#34;: [ { &amp;#34;name&amp;#34;: &amp;#34;Services&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/services&amp;#34;, &amp;#34;weight&amp;#34;: 10 }, { &amp;#34;name&amp;#34;: &amp;#34;About&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/about&amp;#34;, &amp;#34;weight&amp;#34;: 20 }, { &amp;#34;name&amp;#34;: &amp;#34;Contact&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/contact&amp;#34;, &amp;#34;weight&amp;#34;: 30 } ] } } To sort the entries by name, and limit to the first 2 entries:</description></item><item><title>Reverse</title><link>https://v0-122-0--gohugoio.netlify.app/methods/menu/reverse/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/methods/menu/reverse/</guid><description>The Reverse method returns the given menu, reversing the sort order of its entries.
Consider this menu definition:
hugo. yaml &amp;nbsp; toml &amp;nbsp; json &amp;nbsp; menus: main: - name: Services pageRef: /services weight: 10 - name: About pageRef: /about weight: 20 - name: Contact pageRef: /contact weight: 30 [menus] [[menus.main]] name = &amp;#39;Services&amp;#39; pageRef = &amp;#39;/services&amp;#39; weight = 10 [[menus.main]] name = &amp;#39;About&amp;#39; pageRef = &amp;#39;/about&amp;#39; weight = 20 [[menus.main]] name = &amp;#39;Contact&amp;#39; pageRef = &amp;#39;/contact&amp;#39; weight = 30 { &amp;#34;menus&amp;#34;: { &amp;#34;main&amp;#34;: [ { &amp;#34;name&amp;#34;: &amp;#34;Services&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/services&amp;#34;, &amp;#34;weight&amp;#34;: 10 }, { &amp;#34;name&amp;#34;: &amp;#34;About&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/about&amp;#34;, &amp;#34;weight&amp;#34;: 20 }, { &amp;#34;name&amp;#34;: &amp;#34;Contact&amp;#34;, &amp;#34;pageRef&amp;#34;: &amp;#34;/contact&amp;#34;, &amp;#34;weight&amp;#34;: 30 } ] } } To sort the entries by name in descending order:</description></item></channel></rss>