Gopher

Menus

Menus is Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Menu is a slice of objects.

ByName  

() → Menu

ByName sorts the menu by the name defined in the menu configuration.

ByWeight  

() → Menu

ByWeight sorts the menu by the weight defined in the menu configuration.

Limit  

(n int) → Menu

Limit limits the returned menu to n entries.

Reverse  

() → Menu

Reverse reverses the order of the menu entries.

Sort  

() → Menu

Sort sorts the menu by weight, name and then by identifier.

ConfiguredURL
The URL value from front matter / config.
Page
The Page connected to this menu entry.
PageRef
The path to the page, only relevant for menus defined in site config.
Name
The name of the menu entry.
Menu
The menu containing this menu entry.
Identifier
Used to identify this menu entry.
Pre
If set, will be rendered before this menu entry.
Post
If set, will be rendered after this menu entry.
Weight
The weight of this menu entry, used for sorting. Set to a non-zero value, negative or positive.
Parent
Identifier of the parent menu entry.
Children
Child entries.
Params
User defined params.

HasChildren  

() → bool

HasChildren returns whether this menu item has any children.

IsEqual  

(inme MenuEntry) → bool

IsEqual returns whether the two menu entries represents the same menu entry.

IsSameResource  

(inme MenuEntry) → bool

IsSameResource returns whether the two menu entries points to the same resource (URL).

KeyName  

() → string

KeyName returns the key used to identify this menu entry.

Title  

() → string

URL  

() → string

Menus is a map from string to Menu.