hugo/docs/content/en/variables/menus.md
2018-05-04 09:44:59 +02:00

1.3 KiB

title linktitle description date publishdate lastmod categories keywords draft menu weight sections_weight aliases toc
Menu Variables Menu Variables A menu entry in a menu template has specific variables and functions to make menu management easier. 2017-03-12 2017-03-12 2017-03-12
variables and params
menus
false
docs
title parent weight
variables defined by a menu entry variables 50
50 50
/variables/menu/
false

The menu template has the following properties:

.URL
string
.Name
string
.Title
string

This is a link title, meant to be used in title-Attributes of the menu's <a>-tags. By default it returns .Page.LinkTitle, as long as the menu entry was created through the page's front matter and not through the site config. Setting it explicitly in the site config or the page's front matter overrides this behaviour.

.Page
Page Object

The .Page variable holds a reference to the page. It's only set when the menu entry is created from the page's front matter, not when it's created from the site config.

.Menu
string
.Identifier
string
.Pre
template.HTML
.Post
template.HTML
.Weight
int
.Parent
string
.Children
Menu