lib/custom_helpers.rb
# Build div of breadcrumbs from get_breadcrumbs. Not great to define HTML
# inline like this but needed at build time when creating the search index.
Build div of breadcrumbs from get_breadcrumbs. Not great to define HTML
inline like this but needed at build time when creating the search index.
Build div of breadcrumbs from get_breadcrumbs . Not great to define HTML inline like this but needed at build time when creating the search index .
def format_breadcrumb_trail(breadcrumbs, div_class: '')
    result = "<div class='#{div_class}'>"
    breadcrumbs.each_with_index do |(link, name), index|
      if index != breadcrumbs.length - 1
        result += "<span><a href='#{link}'>#{breadcrumb_titleize name}</a></span>"
        result += "<span class='chevron'> / </span>"
      else
        result += "<span class='this-page'>#{breadcrumb_titleize name}</span>"
      end
    end
    result += "</div>"
  end
def format_breadcrumb_trail ( breadcrumbs , div_class : '' ) result = "<div class='#{div_class}'>" breadcrumbs . each_with_index do | ( link , name ) , index | if index != breadcrumbs . length - 1 result += "<span><a href='#{link}'>#{breadcrumb_titleize name}</a></span>" result += "<span class='chevron'> / </span>" else result += "<span class='this-page'>#{breadcrumb_titleize name}</span>" end end result += "</div>" end
Build div of breadcrumbs from get_breadcrumbs.
Build div of breadcrumbs from get_breadcrumbs .
breadcrumbs
div_class