diff options
author | Martin Wright <martin@mynameismartin.com> | 2014-06-13 16:01:19 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-06-17 12:58:33 +0100 |
commit | d0be119c7c495abfdecd4eeba5c51481986e473a (patch) | |
tree | f9a21c4aa4eb223ebd7ab470920e9061591bf7fc | |
parent | f370da987b376ecbf41a0154200f5d91aa69d574 (diff) |
Added breadcrumbs
-rw-r--r-- | _layouts/fullwidth.html | 19 | ||||
-rw-r--r-- | _layouts/page.html | 34 |
2 files changed, 36 insertions, 17 deletions
diff --git a/_layouts/fullwidth.html b/_layouts/fullwidth.html index de253bff0..ef7de85f1 100644 --- a/_layouts/fullwidth.html +++ b/_layouts/fullwidth.html @@ -1,7 +1,25 @@ --- layout: default --- +<div class="page-wrapper"> <div class="page"> +{% capture url_parts %} {{ page.url | remove: "/index.html" | replace:'/'," " }}{% endcapture %} + {% capture num_parts %}{{ url_parts | number_of_words | minus: 1 }}{% endcapture %} + {% assign previous="" %} + <ul class="breadcrumb"> + {% if num_parts == "-1" %} + {% elsif num_parts == "0" %} + <li><a href="/">Home</a></li> + {% else %} + <li><a href="/">Home</a></li> + {% for unused in page.content limit:num_parts %} + {% capture first_word %}{{ url_parts | truncatewords:1 | remove:"..."}}{% endcapture %} + {% capture previous %}{{ previous }}/{{ first_word }}{% endcapture %} + <li><a href="{{ previous }}/">{{ first_word | capitalize }}</a></li> + {% capture url_parts %}{{ url_parts | remove_first:first_word }}{% endcapture %} + {% endfor %} + {% endif %} + </ul> <div class="main-content-column-full-width"> <main role="main" class="main-content"> {{ content }} @@ -9,3 +27,4 @@ layout: default </div> </div> + </div> diff --git a/_layouts/page.html b/_layouts/page.html index 2c1869382..b753f54b7 100644 --- a/_layouts/page.html +++ b/_layouts/page.html @@ -3,23 +3,23 @@ layout: default --- <div class="page-wrapper"> <div class="page"> -{% capture url_parts %} {{ page.url | remove: "/index.html" | replace:'/'," " }}{% endcapture %} - {% capture num_parts %}{{ url_parts | number_of_words | minus: 1 }}{% endcapture %} - {% assign previous="" %} - <ul class="breadcrumb"> - {% if num_parts == "-1" %} - {% elsif num_parts == "0" %} - <li><a href="/">Home</a></li> - {% else %} - <li><a href="/">Home</a></li> - {% for unused in page.content limit:num_parts %} - {% capture first_word %}{{ url_parts | truncatewords:1 | remove:"..."}}{% endcapture %} - {% capture previous %}{{ previous }}/{{ first_word }}{% endcapture %} - <li><a href="{{ previous }}/">{{ first_word | capitalize }}</a></li> - {% capture url_parts %}{{ url_parts | remove_first:first_word }}{% endcapture %} - {% endfor %} - {% endif %} - </ul> + {% capture url_parts %} {{ page.url | remove: "/index.html" | replace:'/'," " }}{% endcapture %} + {% capture num_parts %}{{ url_parts | number_of_words | minus: 1 }}{% endcapture %} + {% assign previous="" %} + <ul class="breadcrumb"> + {% if num_parts == "-1" %} + {% elsif num_parts == "0" %} + <li><a href="/">Home</a></li> + {% else %} + <li><a href="/">Home</a></li> + {% for unused in page.content limit:num_parts %} + {% capture first_word %}{{ url_parts | truncatewords:1 | remove:"..."}}{% endcapture %} + {% capture previous %}{{ previous }}/{{ first_word }}{% endcapture %} + <li><a href="{{ previous }}/">{{ first_word | capitalize }}</a></li> + {% capture url_parts %}{{ url_parts | remove_first:first_word }}{% endcapture %} + {% endfor %} + {% endif %} + </ul> <div class="main-content-column"> <main role="main" class="main-content"> |