forked from magento/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbreadcrumbs.html
52 lines (35 loc) · 1.63 KB
/
breadcrumbs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{% capture url %}{% if page.language%}{{ page.url | remove: "/" | remove: page.language }}{% else %}{{ page.url | remove: "/" }}{% endif %}{% endcapture %}
{% if url.size > 0 %}
<nav class="breadcrumbs">
<a class="breadcrumb-item" href="{% if page.guide_version == site.version or page.guide_version == nil %}{{ site.baseurl }}{% else %}{{ page.baseurl }}{% endif %}"><span>Home</span></a>
<ol class="breadcrumb list-unstyled" vocab="http://schema.org/" typeof="BreadcrumbList">
<!-- Iteration breadcrumb item -->
{% assign position = 0 %}
{% assign breadcrumbs = page.breadcrumbs %}
{% for crumb in breadcrumbs %}
<!-- Skip if root -->
{% if crumb.url == "/" %}
{% continue %}
{% endif %}
<!-- Get breadcrumb title -->
{% assign caption = crumb.title %}
<!-- SEO data -->
{% assign position = position | plus: 1 %}
<li class="breadcrumb-item{% if crumb.url == page.url %} active{% endif %}" property="itemListElement" typeof="ListItem">
{% if crumb.url != page.url %}
<a property="item" typeof="WebPage" href="{{ crumb.url | prepend: page.baseurl }}">
<span property="name">{{ caption }}</span>
</a>
{% else %}
{% if page.layout == 'tutorial' and first_step.url != page.url %}
<a href="{{ first_step.url }}">{{ first_step.title }}</a>
{% endif %}
<span property="name">{{ caption }}</span>
{% endif %}
<meta property="position" content="{{ position }}" />
</li>
{% endfor %}
{% include video/breadcrumbs.html %}
</ol>
</nav>
{% endif %}