package navigation
import "github.com/gohugoio/hugo/navigation"
Index ¶
- Variables
- type Menu
- func (m Menu) Add(me *MenuEntry) Menu
- func (m Menu) ByName() Menu
- func (m Menu) ByWeight() Menu
- func (m Menu) Limit(n int) Menu
- func (m Menu) Reverse() Menu
- func (m Menu) Sort() Menu
- type MenuEntry
- func (m *MenuEntry) HasChildren() bool
- func (m *MenuEntry) IsEqual(inme *MenuEntry) bool
- func (m *MenuEntry) IsSameResource(inme *MenuEntry) bool
- func (m *MenuEntry) KeyName() string
- func (m *MenuEntry) MarshallMap(ime map[string]interface{})
- func (m *MenuEntry) Title() string
- func (m *MenuEntry) URL() string
- type MenuQueryProvider
- type Menus
- type MenusGetter
- type Page
- type PageMenus
- type PageMenusGetter
- type PageMenusProvider
Variables ¶
var NopPageMenus = new(nopPageMenus)
Types ¶
type Menu ¶
type Menu []*MenuEntry
Menu is a collection of menu entries.
func (Menu) Add ¶
func (Menu) ByName ¶
ByName sorts the menu by the name defined in the menu configuration.
func (Menu) ByWeight ¶
ByWeight sorts the menu by the weight defined in the menu configuration.
func (Menu) Limit ¶
Limit limits the returned menu to n entries.
func (Menu) Reverse ¶
Reverse reverses the order of the menu entries.
func (Menu) Sort ¶
Sort sorts the menu by weight, name and then by identifier.
type MenuEntry ¶
type MenuEntry struct { ConfiguredURL string // The URL value from front matter / config. Page Page Name string Menu string Identifier string Pre template.HTML Post template.HTML Weight int Parent string Children Menu Params maps.Params // contains filtered or unexported fields }
MenuEntry represents a menu item defined in either Page front matter or in the site config.
func (*MenuEntry) HasChildren ¶
HasChildren returns whether this menu item has any children.
func (*MenuEntry) IsEqual ¶
IsEqual returns whether the two menu entries represents the same menu entry.
func (*MenuEntry) IsSameResource ¶
IsSameResource returns whether the two menu entries points to the same resource (URL).
func (*MenuEntry) KeyName ¶
KeyName returns the key used to identify this menu entry.
func (*MenuEntry) MarshallMap ¶
func (*MenuEntry) Title ¶
func (*MenuEntry) URL ¶
type MenuQueryProvider ¶
type MenuQueryProvider interface { HasMenuCurrent(menuID string, me *MenuEntry) bool IsMenuCurrent(menuID string, inme *MenuEntry) bool }
func NewMenuQueryProvider ¶
func NewMenuQueryProvider( setionPagesMenu string, pagem PageMenusGetter, sitem MenusGetter, p Page) MenuQueryProvider
type Menus ¶
Menus is a dictionary of menus.
type MenusGetter ¶
type MenusGetter interface { Menus() Menus }
type Page ¶
type Page interface { LinkTitle() string RelPermalink() string Section() string Weight() int IsPage() bool Params() maps.Params }
A narrow version of page.Page.
type PageMenus ¶
PageMenus is a dictionary of menus defined in the Pages.
func PageMenusFromPage ¶
type PageMenusGetter ¶
type PageMenusGetter interface { Menus() PageMenus }
type PageMenusProvider ¶
type PageMenusProvider interface { PageMenusGetter MenuQueryProvider }
Source Files ¶
- Version
- v0.82.0
- Published
- Mar 21, 2021
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 3 hours ago –
Tools for package owners.