View Source SEO.Breadcrumb.ListItem (SEO v0.1.11)
One item in a SEO.Breadcrumb.List
Summary
Functions
One item within a breadcrumb list.
Types
@type t() :: %SEO.Breadcrumb.ListItem{ "@type": String.t(), item: String.t() | URI.t(), name: term(), position: pos_integer() }
Functions
@spec build(SEO.attrs(), SEO.config()) :: t() | nil
One item within a breadcrumb list.
The two required keys for every item are:
:item
- The URL of the item, eg: "https://example.com/cats".:name
- The name of the item, eg: "Cats"
You may optionally provide the position. If unset, then one will be generated for you based on its position in the list. (1-based)
:position
- The position in the breadcrumb list, eg: 1 (first)
For example:
SEO.Breadcrumb.ListItem.build(%{
name: "Posts",
item: Routes.blog_url(@endpoint, :index)
})