Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flat ¶
Flat creates a flatMap from the original items passed. It marks any nav item whose url is contained within the current request url path as being active
func Level ¶
func Level(items []*Nav, r *http.Request) (nav map[string]*Nav, activeSection *Nav, activePage *Nav)
Level checks only the current level (does not recurse) of the nav items passed to see if any "active" (url contains current url) If active is found then also run the activate check on the subitems
Types ¶
type Nav ¶
type Nav struct {}
func Activate ¶
Activate checks each nav item in the tree of items passed to see if the url exactly matches the current url path and sets the .Active flag when it does
Used to help nav display
func ForTemplate ¶
ForTemplate creates a list of all nav items from the list passed whose template matches the templateName
Click to show internal directories.
Click to hide internal directories.