Sha256: 19e67169dca5bd27ac251fa314829c3c11a81d850d4735a4396b64c5f1a9aab6

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 KB

Contents

<%
  breadcrumbs ||= []
  inverse ||= false
  collapse_on_mobile ||= false
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)

  classes = "gem-c-breadcrumbs govuk-breadcrumbs"
  classes << " gem-c-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
  classes << " gem-c-breadcrumbs--inverse" if inverse
%>

<script type="application/ld+json">
  <%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
</script>

<div class="<%= classes %>" 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

6 entries across 6 versions & 1 rubygems

Version Path
govuk_publishing_components-21.62.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-21.61.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-21.60.3 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-21.60.2 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-21.60.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-21.60.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb