Menu

Menu


Returns the identifier of the menu that contains the given menu entry. 返回包含给定菜单项的菜单的标识符。

{{ range .Site.Menus.main }}
  {{ .Menu }} → main
{{ end }}

Use this method with the IsMenuCurrent and HasMenuCurrent methods on a Page object to set “active” and “ancestor” classes on a rendered entry. See [this example].

将此方法与对象上的IsMenuCurrent和方法结合使用,以在呈现的条目上设置“活动”和“祖先”类。请参阅此示例。HasMenuCurrentPage