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

t()

@type t() :: %SEO.Breadcrumb.ListItem{
  "@type": String.t(),
  item: String.t() | URI.t(),
  name: term(),
  position: pos_integer()
}

Functions

build(attrs, default \\ nil)

@spec build(SEO.attrs(), SEO.config()) :: t() | nil

One item within a breadcrumb list.

The two required keys for every item are:

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)
})