Add breadcrumb navigation include

- Disable by default
- Add schema.org markup
- Add basic styling
This commit is contained in:
Michael Rose 2016-03-04 22:57:12 -05:00
parent 239c949298
commit 7c77274567
5 changed files with 63 additions and 13 deletions

View file

@ -7,14 +7,17 @@
# Site Settings # Site Settings
locale : en_US locale : en_US
title : "Your awesome site" title : "Your Awesome Site"
name : &name "Your Name"
title_separator : "-" title_separator : "-"
name : &name "Your Name"
description : &description "Write an awesome description for your new site here." description : &description "Write an awesome description for your new site here."
url : "http://localhost:4000" # the base hostname & protocol for your site url : "http://localhost:4000" # the base hostname & protocol for your site
baseurl : "/minimal-mistakes" # the subpath of your site, e.g. /blog baseurl : "/minimal-mistakes" # the subpath of your site, e.g. /blog
email : "your-email@domain.com" email : "your-email@domain.com"
logo : "site-logo.png" logo : "site-logo.png"
breadcrumbs : # true / false (default)
breadcrumb_home_label : "Home"
breadcrumb_separator : "/"
twitter: twitter:
username : &twitter "site_twitter" username : &twitter "site_twitter"
facebook: facebook:
@ -135,7 +138,7 @@ gems:
- jekyll-gist - jekyll-gist
# Outputting # Outputting
permalink: /:title/ permalink: /:categories/:title/
paginate_path: /page:num paginate_path: /page:num
timezone: America/New_York # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: America/New_York # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

View file

@ -0,0 +1,25 @@
<nav class="breadcrumbs">
<ol itemscope itemtype="http://schema.org/BreadcrumbList">
{% 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">
<a href="{{ absurl }}/" itemprop="item"><span itemprop="name">{{ site.breadcrumb_home_label }}</span></a>
<meta itemprop="position" content="{{ i }}" />
</li>
<span class="sep">{{ site.breadcrumb_separator }}</span>
{% endif %}
{% if forloop.last %}
<li class="current">{{ page.title }}</li>
{% else %}
{% assign i = i | plus: 1 %}
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a href="{{ absurl }}{% assign crumb_limit = forloop.index | plus: 1 %}{% for crumb in crumbs limit: crumb_limit %}{{ crumb | append: '/' }}{% endfor %}" itemprop="item"><span itemprop="name">{{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }}</span></a>
<meta itemprop="position" content="{{ i }}" />
</li>
<span class="sep">{{ site.breadcrumb_separator }}</span>
{% endif %}
{% endfor %}
</ol>
</nav>

View file

@ -30,6 +30,10 @@ layout: compress
</div><!-- /.image-wrap --> </div><!-- /.image-wrap -->
{% endif %} {% endif %}
{% if site.breadcrumbs %}
{% include breadcrumbs.html %}
{% endif %}
<div id="main" role="main"> <div id="main" role="main">
<div class="author-profile"> <div class="author-profile">
{% include author-profile.html %} {% include author-profile.html %}

View file

@ -1,7 +1,7 @@
--- ---
layout: archive layout: archive
title: "Recipes Archive" title: "Recipes Archive"
permalink: /recipes-archive/ permalink: /recipes/
--- ---
{% include absolute-url.liquid %} {% include absolute-url.liquid %}
{% include group-by-array.html collection=site.recipes field='categories' %} {% include group-by-array.html collection=site.recipes field='categories' %}

View file

@ -654,6 +654,7 @@ $button-size: 1.5rem;
} }
} }
} }
/* /*
Google search form Google search form
========================================================================== */ ========================================================================== */
@ -685,3 +686,20 @@ $button-size: 1.5rem;
#goog-wm-sb { #goog-wm-sb {
@extend .btn; @extend .btn;
} }
/*
Breadcrumbs
========================================================================== */
.breadcrumbs {
ol {
padding: 0;
list-style: none;
}
li {
display: inline;
}
.current {
font-weight: bold;
}
}