summaryrefslogtreecommitdiff
path: root/_includes/breadcrumbs.html
blob: a4f992ea29171a5be9e44d1fed0baccd12e24716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<nav aria-label="Breadcrumb" id="breadcrumbs" style="font-size: 0.8em">
  {% assign crumbs = page.url | remove:'/index.html' | split: '/' %}
  <a href="/">Home</a>
  {% for crumb in crumbs offset: 1 %} {% if forloop.last %} / {{ page.title }}
  {% else %} {% assign crumb_limit = forloop.index | plus: 1 %} /
  <a
    href="{% for crumb in crumbs limit: crumb_limit %}{{ crumb | append: '/' }}{% endfor %}"
  >
    {{ crumb | replace:'-',' ' | remove:'.html' | capitalize }}
  </a>
  {% endif %} {% endfor %}
</nav>

<style>
  nav[aria-label="Breadcrumb"] {
    display: inline-block;
    opacity: 0.5;
    transition: opacity 0.1s;
  }
  nav[aria-label="Breadcrumb"]:hover {
    opacity: 1;
  }
</style>