From 5d392c3d4576f03d93e99c9e2c46cafd135d3f50 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 15 Apr 2023 14:28:54 -0700 Subject: [PATCH] Clarify pageRef menu property (#2059) --- content/en/content-management/menus.md | 24 ++++++++++++++++-------- content/en/templates/menu-templates.md | 4 ++-- content/en/variables/menus.md | 5 +++-- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/content/en/content-management/menus.md b/content/en/content-management/menus.md index b4b97f2df0..369938aba7 100644 --- a/content/en/content-management/menus.md +++ b/content/en/content-management/menus.md @@ -148,23 +148,31 @@ This creates a menu structure that you can access with `site.Menus.footer` in yo ### Properties {#properties-site-configuration} +{{% note %}} +The [properties available to entries defined in front matter] are also available to entries defined in site configuration. + +[properties available to entries defined in front matter]: /content-management/menus/#properties-front-matter +{{% /note %}} + Each menu entry defined in site configuration requires two or more properties: - Specify `name` and `pageRef` for internal links - Specify `name` and `url` for external links pageRef -: (`string`) The file path of the target page, relative to the `content` directory. Required for *internal* links. +: (`string`) The file path of the target page, relative to the `content` directory. Omit language code and file extension. Required for *internal* links. + +Kind|pageRef +:--|:-- +home|`/` +page|`/books/book-1` +section|`/books` +taxonomy|`/tags` +term|`/tags/foo` url : (`string`) Required for *external* links. -{{% note %}} -The [properties] available to entries defined in front matter are also available to entries defined in site configuration. - -[properties]: /content-management/menus/#properties-front-matter -{{% /note %}} - ### Example {#example-site-configuration} This nested menu demonstrates some of the available properties: @@ -211,7 +219,7 @@ Hugo provides two methods to localize your menu entries. See [multilingual]. See [menu templates]. -[Localize]: /content-management/multilingual/#menus +[localize]: /content-management/multilingual/#menus [menu templates]: /templates/menu-templates/ [multilingual]: /content-management/multilingual/#menus [template]: /templates/menu-templates/ diff --git a/content/en/templates/menu-templates.md b/content/en/templates/menu-templates.md index ff6971a334..b858ebd21d 100644 --- a/content/en/templates/menu-templates.md +++ b/content/en/templates/menu-templates.md @@ -120,7 +120,7 @@ Hugo provides two methods to localize your menu entries. See [multilingual]. [in front matter]: /content-management/menus/#define-in-front-matter [in site configuration]: /content-management/menus/#define-in-site-configuration [localize the menu entries]: /content-management/multilingual/#menus -[Menu entry defined in front matter]: /content-management/menus/#example-front-matter -[Menu entry defined in site configuration]: /content-management/menus/#example-site-configuration +[menu entry defined in front matter]: /content-management/menus/#example-front-matter +[menu entry defined in site configuration]: /content-management/menus/#example-site-configuration [menu variables and methods]: /variables/menus/ [multilingual]: /content-management/multilingual/#menus diff --git a/content/en/variables/menus.md b/content/en/variables/menus.md index 9a6fe517af..b88514803e 100644 --- a/content/en/variables/menus.md +++ b/content/en/variables/menus.md @@ -13,7 +13,7 @@ aliases: [/variables/menu/] ## Variables -After [defining the menu entries], access their properties with these variables. +After [defining menu entries], access their properties in [menu templates] with these variables. .Children : (`menu`) A collection of child menu entries, if any, under the current menu entry. @@ -86,6 +86,7 @@ After [defining the menu entries], access their properties with these variables. : (`bool`) Use this method to determine the active menu entry. See [details](/functions/ismenucurrent/). [automatically]: /content-management/menus/#define-automatically -[defining the menu entries]: /content-management/menus/#overview +[defining menu entries]: /content-management/menus/#overview [in front matter]: /content-management/menus/#define-in-front-matter [in site configuration]: /content-management/menus/#define-in-site-configuration +[menu templates]: /templates/menu-templates/