Sha256: 4d3f3feecbf9c3ba67cd532cc6e11698f2263bfd123578bd4d72db7c5a0208c8
Contents?: true
Size: 1.51 KB
Versions: 38
Compression:
Stored size: 1.51 KB
Contents
<% add_gem_component_stylesheet("breadcrumbs") border ||= false breadcrumbs ||= [] collapse_on_mobile ||= false inverse ||= false breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs) classes = %w[gem-c-breadcrumbs govuk-breadcrumbs] classes << "govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile classes << "gem-c-breadcrumbs--inverse" if inverse classes << "gem-c-breadcrumbs--border-bottom" if border == "bottom" component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns) component_helper.add_class(classes.join(" ")) component_helper.add_aria_attribute({ label: "Breadcrumb" }) component_helper.add_data_attribute({ module: "ga4-link-tracker" }) %> <script type="application/ld+json"> <%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %> </script> <%= tag.nav(**component_helper.all_attributes) do %> <ol class="govuk-breadcrumbs__list"> <% breadcrumbs.each_with_index do |crumb, index| %> <% breadcrumb = GovukPublishingComponents::Presenters::Breadcrumb.new(crumb, index) %> <li class="govuk-breadcrumbs__list-item"> <% if breadcrumb.is_link? %> <%= link_to( breadcrumb[:title], breadcrumb.path, data: breadcrumb.tracking_data(breadcrumbs.length), class: "govuk-breadcrumbs__link", ) %> <% else %> <%= breadcrumb[:title] %> <% end %> </li> <% end %> </ol> <% end %>
Version data entries
38 entries across 38 versions & 1 rubygems