Skip to content

Instantly share code, notes, and snippets.

@machida
Last active January 17, 2019 06:36
Show Gist options
  • Save machida/3f6628be6d46ed36aa7053cd01799c6f to your computer and use it in GitHub Desktop.
Save machida/3f6628be6d46ed36aa7053cd01799c6f to your computer and use it in GitHub Desktop.
<% if breadcrumbs.present? %>
<ol class="breadcrumbs" vocab="http://schema.org/" typeof="BreadcrumbList">
<% breadcrumbs.each_with_index do |breadcrumb, i| %>
<li class="breadcrumb" property="itemListElement" typeof="ListItem">
<%= link_to breadcrumb.url, itemtype: "http://schema.org/Thing", itemprop: "item" do %>
<span property="name">
<%= breadcrumb.name %>
</span>
<meta property="position" content="<%= i+1 %>">
<% end %>
</li>
<% end %>
</ol>
<% end %>
- if breadcrumbs.present?
%ol.breadcrumbs{typeof: "BreadcrumbList", vocab: "http://schema.org/"}
- breadcrumbs.each_with_index do |breadcrumb, i|
%li.breadcrumb{property: "itemListElement", typeof: "ListItem"}
= link_to breadcrumb.url, itemtype: "http://schema.org/Thing", itemprop: "item" do
%span{property: "name"}
= breadcrumb.name
%meta{content: "#{i+1}", property: "position"}
- if breadcrumbs.present?
ol.breadcrumbs typeof="BreadcrumbList" vocab="http://schema.org/"
- breadcrumbs.each_with_index do |breadcrumb, i|
li.breadcrumb property="itemListElement" typeof="ListItem"
= link_to breadcrumb.url, itemtype: "http://schema.org/Thing", itemprop: "item" do
span property="name"
= breadcrumb.name
meta content="#{i+1}" property="position"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment