_includes/breadcrumbs.html (51 lines of code) (raw):

{% case site.categories.type %} {% when "liquid" %} {% assign path_type = "#" %} {% when "jekyll-archives" %} {% assign path_type = nil %} {% endcase %} {% if page.collection != 'posts' %} {% assign path_type = nil %} {% assign crumb_path = '/' %} {% else %} {% assign crumb_path = site.categories.path %} {% endif %} {% if page.breadcrumbColor %} {% assign breadClass = page.breadcrumbColor %} {% else %} {% assign breadClass = "bg-blue-light" %} {% endif %} {% if page.breadcrumbSize %} {% assign size = page.breadcrumbSize %} {% else %} {% assign size = "md" %} {% endif %} <nav class="{{ breadClass }} py-2 border-bottom" aria-label="Breadcrumb"> <ol itemscope itemtype="http://schema.org/BreadcrumbList" class="container-{{ size }} p-responsive"> {% assign crumbs = page.url | split: '/' %} {% assign i = 1 %} {% for crumb in crumbs offset: 1 %} {% if forloop.first %} <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="breadcrumb-item"> <a href="{{ site.baseurl }}/" itemprop="item"> {{ site.data.ui-text[site.locale].breadcrumb_home_label }} </a> <meta itemprop="position" content="{{ i }}" /> </li> {% endif %} {% if forloop.last %} <li class="breadcrumb-item breadcrumb-item-selected text-gray" aria-current="page"> {{ page.title }} </li> {% else %} {% assign i = i | plus: 1 %} <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="breadcrumb-item"> <a href="{{ site.baseurl }}{{ crumb | downcase | replace: '%20', '-' | prepend: path_type | prepend: crumb_path }}" itemprop="item"> {{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }} </a> <meta itemprop="position" content="{{ i }}" /> </li> {% endif %} {% endfor %} </ol> </nav>