Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Breadcrumbs ¶
type Breadcrumbs struct { Enabled bool `json:"enabled"` Title string `json:"title"` Separator string `json:"separator"` Items Items `json:"crumbs"` }
Breadcrumbs represent the navigation aid for displaying hierarchical content within verbis. Various options are included within the type as well as the trail of crumbs (a slice of Items).
func GetBreadcrumbs ¶
func GetBreadcrumbs(post *domain.PostDatum, d *deps.Deps) Breadcrumbs
GetBreadcrumbs retrieves the breadcrumbs for a specific post. If the breadcrumbs are not enabled from the options, an empty Breadcrumbs type will be returned. The homepage is automatically prepended and subsequent URL's are split and matches are looked up from the database.
type Item ¶
type Item struct { Link string `json:"link"` Text string `json:"text"` Position int `json:"position"` Found bool `json:"found"` Active bool `json:"active"` }
Item represents a singular crumb. It includes the link, link text, (the post title or a clean version of the URL segment if no post was found), the position of the breadcrumb and weather or not the item was successfully retrieved from the database.