Sha256: 534ccc19b3ebd628cc2f2f1a99b83e8b05add1563207b2ac86327cb31063f2f4

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

<%
  breadcrumbs ||= []
  inverse ||= false
  invert_class = inverse ? "gem-c-breadcrumbs--inverse" : ""
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs, request.path)
%>

<script type="application/ld+json">
  <%= raw breadcrumb_presenter.structured_data.to_json %>
</script>

<div class="gem-c-breadcrumbs govuk-breadcrumbs <%= invert_class %>" data-module="track-click">
  <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" aria-current="<%= breadcrumb.aria_current %>">
        <% if breadcrumb.is_link? %>
          <%= link_to(
            breadcrumb[:title],
            breadcrumb.path,
            data: breadcrumb.tracking_data(breadcrumbs.length),
            class: "govuk-breadcrumbs__link",
            aria: {
              current: breadcrumb.aria_current,
            }
          ) %>
        <% else %>
          <%= breadcrumb[:title] %>
        <% end %>
      </li>
    <% end %>
  </ol>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
govuk_publishing_components-21.23.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-21.23.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-21.22.2 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb