-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move breadcrumb
name
and position
to own elements
- Loading branch information
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
<nav aria-label="Breadcrumbs" class="w-full mb-12 md:mb-0"> | ||
<ul itemscope itemtype="https://schema.org/BreadcrumbList" class="flex items-start gap-3 grow flex-wrap sm:items-center"> | ||
<% @breadcrumbs.each_with_index do |breadcrumb, index| %> | ||
<li class="flex items-center" itemprop="itemListElement" itemscope name="<%= breadcrumb[:text] %>" postition="<%= index + 1 %>" itemtype="https://schema.org/ListItem"> | ||
<%= link_to breadcrumb[:text], | ||
<li class="flex items-center" itemprop="itemListElement" itemscope postition="<%= index + 1 %>" itemtype="https://schema.org/ListItem"> | ||
<%= link_to( | ||
breadcrumb[:path], | ||
class: "font-medium text-sm text-slate-300 hover:text-white transition transition duration-150 ease-in-out #{index == @breadcrumbs.size - 1 ? "text-slate-50" : ''}", | ||
itemprop: "item" %> | ||
itemprop: "item" | ||
) do %> | ||
<span itemprop="name"><%= breadcrumb[:text] %></span> | ||
<% end %> | ||
|
||
<meta itemprop="position" content="<%= index + 1 %>"> | ||
|
||
<span class="text-slate-300 ml-2"> | ||
<% unless index == @breadcrumbs.size - 1 %> | ||
<svg class="h-5 w-5 flex-shrink-0 text-slate-300" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> | ||
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" /> | ||
</svg> | ||
<% end %> | ||
</span> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</nav> |